Sheriffing/How To/Unified Repos: Difference between revisions

Backouts
(hg in equivalent)
(Backouts)
Line 93: Line 93:


=== Backouts ===
=== Backouts ===
TBD
Better tools are coming:
* https://bugzilla.mozilla.org/show_bug.cgi?id=1117632
* https://bugzilla.mozilla.org/show_bug.cgi?id=1121211
<br />
 
The standard backout command makes backing out revisions more difficult than it should, as it won't pre-fill the backout commit message with a bug number:
* Copy backout <revision> from treeherder, note the bug <number>, and remember the <reason>
* `hg backout -r <revision>`
** This should open up your editor with a completely empty commit message. Type in the backout message like "Backout revision <revision> (bug <number>) for <reason>" (possibly with "CLOSED TREE" in there to get around a closure hook).
* `hg push -r . <tree>`
 
[https://hg.mozilla.org/hgcustom/version-control-tools/file/4e7ab9638cf0/hgext/qbackout qbackout] can probably still be used (assuming you don't use `hg share` to get multiple working directories, as mq doesn't play nice with shared repos):
* Copy the backout <revision> from treeherder
* `hg qbackout -e -r <revision>`
** This should open up your editor with a pre-formed commit message like "Backed out <revision> (bug <number>)". Add in the <reason> and possibly "CLOSED TREE" to get around a closure hook.
* `hg qfin -a && hg push -r . <tree>`
 
qbackout can also back out a range of commits in a single backout commit:
* `hg qbackout -e -s -r <toprevision>:<bottomrevision>`
** This will open your editor with a pre-formed commit message like "Backed out <toprevision>,<anymiddlerevisions>,<bottomrevision> (bug <number>,any other bug <numbers>)". Add in the <reason> and possibly "CLOSED TREE" to get around a closure hook.
* `hg qfin -a ** hg push -r . <tree>`
(Omit qbackout's -s flag to back out each individual revision in the range as a separate commit.)


=== Rebasing after losing a push race ===
=== Rebasing after losing a push race ===
Confirmed users
396

edits