Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do it using just the <code>-I</code> (include names matching the given patterns) argument for backout with a single line:</p> <pre><code>hg backout --merge -I thefiletorevert -m 'message' OFFENDINGREVISIONID </code></pre> <p><strong>Example Script:</strong></p> <pre><code>hg init testrepo cd testrepo echo -e "line1\n\nline3" &gt; file1 echo -e "line1\n\nline3" &gt; file2 hg commit -A -m 'changes to two files' perl -pi -e 's/line1/line 1/' file1 perl -pi -e 's/line1/line 1/' file2 hg commit -m 'put spaces in line1' perl -pi -e 's/line3/line 3/' file1 perl -pi -e 's/line3/line 3/' file2 hg commit -m 'put spaces in line3' hg backout --merge -I file1 -m 'remove spaces from line1' 1 </code></pre> <p><strong>Sample output:</strong></p> <pre><code>adding file1 adding file2 reverting file1 created new head changeset 3:6d354f1ad4c5 backs out changeset 1:906bbeaca6a3 merging with changeset 3:6d354f1ad4c5 merging file1 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) </code></pre> <p><strong>Resulting File Contents:</strong></p> <pre><code>file1:line1 file1:line 3 file2:line 1 file2:line 3 </code></pre> <p>notice that file1 is missing it's space in line one after the backout of the middle changeset, and the verbose log shows only one file changed in the backout:</p> <pre><code>$ hg log -v -r tip changeset: 3:6d354f1ad4c5 tag: tip parent: 1:906bbeaca6a3 user: Ry4an Brase &lt;ry4an@mini&gt; date: Mon Sep 14 12:17:23 2009 -0500 files: file1 description: remove spaces from line1 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload