Sheriffing/How To/Merge Conflicts: Difference between revisions

Jump to navigation Jump to search
First final version of example
(save progress)
(First final version of example)
Line 28: Line 28:
These files with the conflicts got changed on both inbound and central (which got the change from the previous merge from autoland.</li>
These files with the conflicts got changed on both inbound and central (which got the change from the previous merge from autoland.</li>
<li>Let's abandon the merge and back out the conflicting changes to these files from the integration repository (inbound!). Update the working repository to the inbound revision which shall be merged: <code>hg update -C a84fff04d938</code></li>
<li>Let's abandon the merge and back out the conflicting changes to these files from the integration repository (inbound!). Update the working repository to the inbound revision which shall be merged: <code>hg update -C a84fff04d938</code></li>
<li>Now the bug with the changesets which cause the merge conflicts have to be identified. On [https://hg.mozilla.org hg.mozilla.org], open the repository to which shall be merged (in this case: mozilla-central).</li>
<li>Now the bugs with the changesets which cause the merge conflicts have to be identified. On [https://hg.mozilla.org hg.mozilla.org], open the repository to which shall be merged (in this case: mozilla-central).</li>
<li>Click on 'Files' in the header and navigate to the folder which contains the file with the merge conflict. This is [https://hg.mozilla.org/mozilla-central/file/597025d8888fa91b9418231f33e65424d384d83f/mobile/android/base mobile/android/base/] in this case.</li>
<li>Click on 'Files' in the header and navigate to the folder which contains the file with the merge conflict. This is [https://hg.mozilla.org/mozilla-central/file/597025d8888fa91b9418231f33e65424d384d83f/mobile/android/base mobile/android/base/] in this case.</li>
<li>Click on the [https://hg.mozilla.org/mozilla-central/log/597025d8888fa91b9418231f33e65424d384d83f/mobile/android/base/moz.build revisions] name next to the file name, in this case moz.build.</li>
<li>Click on the [https://hg.mozilla.org/mozilla-central/log/597025d8888fa91b9418231f33e65424d384d83f/mobile/android/base/moz.build revisions] link next to the file name, in this case moz.build.</li>
<li>Now you can see the recent changes to the file. The latest changes got <code>pushed 2017-11-07 10:28 +0000</code> and are from [https://bugzilla.mozilla.org/show_bug.cgi?id=1413698 bug 1413698]. The bug contains information what changesets belong to that push. You only need that information if you want to fix the merge conflict by manually merging the code.</li>
<li>Now you can see the recent changes to the file. The latest changes got <code>pushed 2017-11-07 10:28 +0000</code> and are from [https://bugzilla.mozilla.org/show_bug.cgi?id=1413698 bug 1413698]. The bug contains information what changesets belong to that push. You only need that information if you want to fix the merge conflict by manually merging the code.</li>
<li>Do the same thing for mozilla-inbound, this time it's mandatory. Copying the url of the tab with the revision history, opening a new tab and pasting the url while replacing "/mozilla-central/" with "/integration/mozilla-inbound/" and the revision (here "597025d8888fa91b9418231f33e65424d384d83f") with "tip" is often a useful shortcut (but will even show changes which landed after the merge candidate you picked; if you don't want that, use the revision of the merge candidate). This got [https://hg.mozilla.org/integration/mozilla-inbound/log/a84fff04d938/mobile/android/base/moz.build this changelog].</li>
<li>Do the same thing for mozilla-inbound, this time it's mandatory. Copying the url of the tab with the revision history, opening a new tab and pasting the url while replacing "/mozilla-central/" with "/integration/mozilla-inbound/" and the revision (here "597025d8888fa91b9418231f33e65424d384d83f") with "tip" is often a useful shortcut (but will even show changes which landed after the merge candidate you picked; if you don't want that, use the revision of the merge candidate). This got [https://hg.mozilla.org/integration/mozilla-inbound/log/a84fff04d938/mobile/android/base/moz.build this changelog].</li>
Line 37: Line 37:
<li>Do a backout for these changesets:<br>
<li>Do a backout for these changesets:<br>
<code>hg oops -esr 653c66220a5f::8b15dfaeecaa</code></li>
<code>hg oops -esr 653c66220a5f::8b15dfaeecaa</code></li>
<li>The working directory is now in a state which allows merging with central. Run:<br>
<code>hg merge central</code></li>
<li>Then:<br>
<code>hg commit</code></li>
<li>Push the backout and the merge to central:<br>
<code>hg push tip central</code></li>
<li>Update the bug about the backout.</li>
<li>Merge back from central as usual.</li>
<li>Get rid of the files left over from the merge conflicts with the original state of the files. They are in the same folder like the files for which the merge failed, but got an additional <code>.orig</code> file extension. To achieve this, run:<br>
<code>hg purge</code><br>
If you the Mercurial purge extension hasn't been enabled yet, open the <code>.hgrc</code> file in your home directory and add the following line below <code>[extensions]</code>:<br>
<code>purge =</code></li>
</ol>
</ol>
Confirmed users
611

edits

Navigation menu