[issue2758] Need a way to indicate which parent to follow for annotate purposes after merges

Boris Zbarsky bugs at mercurial.selenic.com
Fri Apr 8 03:47:12 UTC 2011


New submission from Boris Zbarsky <bzbarsky at mit.edu>:

Consider the following sequence of mercurial commands, in a new directory:

% hg init
% echo 1 > testfile
% hg add testfile
% hg comm -m "1"
% echo 2 >> testfile
% hg comm -m "2"
% mv testfile newname
% hg addremove
adding newname
removing testfile
% hg comm -m "moved"
% hg up -C -r 1
% hg mv testfile newname
% hg comm -m "moved2"
% hg merge
% hg comm -m "merged"

Yes, I realize this is a daft thing to do in the first place, but this was
an attempt to fix a bogus file move on someone's part.

The problem is that after this hg annotate on newname shows it as all coming
from revision 2 (the "moved" revision).  Had the merger run 

  hg up -C -r 2

before merging, hg annotate would show newname as coming from revisions 0 and 1.

There is no good way to handle this in general, as far as I can tell.  But
it would be very useful if it were possible to indicate to annotate, or at
least the hgweb version of it, which parent to follow in merge cases like
this.  This is actually being a serious problem for the mozilla-central
repository, because at some point someone did the hg addremove thing above
or equivalent on the networking code, and the attempt to work around it
using hg move and merges didn't work; I'm guessing because of which parent
was used as parent 1 for the merge.

----------
messages: 16019
nosy: bzbarsky
priority: feature
status: unread
title: Need a way to indicate which parent to follow for annotate purposes after merges

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2758>
____________________________________________________


More information about the Mercurial-devel mailing list