folding commits with renames generates conflicts
Cristian Vasile Mocanu
cvmocanu at gmail.com
Fri May 16 09:43:50 UTC 2014
Hi Fritz,
Thanks for trying to help.
Here is a stripped-down version of how to reproduce this. Sorry, I
should have prepare this for the initial posting.
$ hg init
$ mkdir initial-dir ; echo foo > initial-dir/initial-file ; hg add
initial-dir/initial-file ; hg commit -m "initial commit"
$ mkdir another-dir ; hg mv initial-dir/initial-file another-dir/ ; echo
changed > another-dir/initial-file ; hg commit -m "moved and changed"
$ hg mv another-dir/initial-file another-dir/renamed-file ; hg commit -m
"renamed"
$ hg histedit --rev "draft()"
> pick 6ed6458efaa6 0 initial commit
> fold 652030fdfb10 1 moved and changed
> pick 13e1a480f2a7 2 renamed
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
adding another-dir\initial-file
removing initial-dir\initial-file
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
local changed another-dir/initial-file which remote deleted
use (c)hanged version or (d)elete?
I think the conflict is when it tries to apply the 3rd commit.
The expected outcome it so have the file in the same state as if I had 3
commits (before the fold), namely:
- the content of the file should be "changed"
- the name of the file should be "another-dir/renamed-file"
And of course, I don't expect conflicts.
Thanks a lot,
Cristian
On 16-05-2014 10:52, Kastner Masilko, Friedrich wrote:
>> From: mercurial-bounces at selenic.com [mailto:mercurial-bounces at selenic.com] On Behalf Of Cristian Vasile Mocanu
>>
>> The problem is that quite often, when I fold a commit into the commit
>> above, and there was a file rename involved, I get a conflict, and
>> Mercurial asks: "use (c)hanged version or (d)elete?".
>> It looks like Mercurial can't apply changes to file which were renamed,
>> which is strange since Mercurial has better metadata than GIT (GIT has
>> to guess renames whereas Mercurial has the rename metadata so it
>> doesn't have to guess).
>>
>> I have 2 questions:
>> 1) is this a Mercurial bug? If it is, is it reported?
>> 2) is there a workaround?
> Perhaps it is a shortcoming in the histedit extension, but this is hard to say without an appropriate use-case and a reproducible example.
>
> Could you perhaps provide a stripped-down script to better demonstrate what happens, and a description to show what you think that should happen?
>
> regards,
> Fritz
>
>
>
> Development Software Systems
> Festo Gesellschaft m.b.H.
> Linzer Strasse 227
> Austria - 1140 Wien
>
> Firmenbuch Wien
> FN 38435y
> UID: ATU14650108
>
> Tel: +43(1)91075-198
> Fax:
> www.festo.at
>
> Der Inhalt dieser E-Mail und moeglicher Anhaenge sind ausschliesslich fuer den bezeichneten Adressaten bestimmt.
> Jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail und
> moeglicher Anhaenge durch unberechtigte Dritte ist unzulaessig. Wir bitten Sie, sich mit dem Absender der E-Mail in
> Verbindung zu setzen, falls Sie nicht der Adressat dieser E-Mail sind sowie das Material von Ihrem Computer zu loeschen.
>
> This e-mail and any attachments are confidential and intended solely for the addressee. The perusal, publication, copying or
> dissemination of the contents of this e-mail by unauthorised third parties is prohibited. If you are not the intended recipient of this
> e-mail, please delete it and immediately notify the sender.
>
More information about the Mercurial
mailing list