Loosing revision history after rename and compress/rebase
Weichelt David J
WeicheltDavid at JohnDeere.com
Tue Jan 7 21:09:32 UTC 2014
Response below:
-----Original Message-----
From: Becker, Mischa J [mailto:mischa.becker at fredmeyer.com]
Sent: Tuesday, January 07, 2014 2:50 PM
To: Weichelt David J; Matt Mackall
Cc: Albright Steve; Bogh Jason; mercurial at selenic.com; Faber Ross
Subject: RE: Loosing revision history after rename and compress/rebase
> -----Original Message-----
> From: mercurial-bounces at selenic.com [mailto:mercurial-
> bounces at selenic.com] On Behalf Of Weichelt David J
> Sent: Tuesday, January 07, 2014 9:09 AM
> To: Matt Mackall
> Cc: Albright Steve; Bogh Jason; mercurial at selenic.com; Faber Ross
> Subject: RE: Loosing revision history after rename and compress/rebase
>
> Response below.
> -----Original Message-----
> From: Matt Mackall [mailto:mpm at selenic.com]
> Sent: Friday, January 03, 2014 6:13 PM
> To: Weichelt David J
> Cc: mercurial at selenic.com; Albright Steve; Bogh Jason; Faber Ross
> Subject: Re: Loosing revision history after rename and compress/rebase
>
> On Fri, 2014-01-03 at 22:53 +0000, Weichelt David J wrote:
> > I'm looking for support on this problem we have seen. The scenario
> was confirmed with other developers and it perhaps needs to be fixed
> by the Mercurial community... we don't know how to work around this.
> Not cool to loose revision history from code that we are moving around
> and changing.
> >
> > Steps to reproduce:
> >
> > 1. Have a committed file with a revision history
> >
> > 2. Hg rename the file from one directory to a new one (with
> renaming the file in my testing)
> >
> > 3. Commit the changes
> >
> > 4. Compress the changes (also can see same problem with rebase)
>
> This is not a term in our jargon. Perhaps you mean rebase --collapse?
> Or perhaps the THG project has taken to introducing their own jargon.
> <David> THG has compress and rebase as two different options.
THG has a Compress History right-click option if you've selected two changesets. Is that the one you mean?
<David> Yes.
> > 5. (optional) Strip the original changset that was compressed
> >
> > 6. Notice that the revision history is missing on the new
> changeset
>
> Are you saying that the renamed file does not have any evidence of
> linkage to the original file? How are you determining this?
>
> <David> Yes, the renamed file doesn't have evidence of linkage to the
> original file (and thus the history of the original file). It appears
> that the renamed file is a new file with only 1 changeset.
Assuming you are using Compress History, all it does is:
% hg update --clean --rev [ancestor]
% hg revert --all --rev [descendant]
It then opens the commit screen and prepopulates the commit message with all messages from the revisions you are compressing. You can make any changes you want before hitting the commit button.
I've been playing around with a test repo but the only way I can make the compressed changeset not know about the rename is if it was never marked as a rename in the first place. Can you recreate the problem?
Mischa
<David> Thanks for the help... I'm actually not sure about the commandline as we have been using TortoiseHg. I just sent the question to that support mailing list as well. We did recreate the problem multiple times. One time we make some simple changes to just see if we could and thus I recorded the steps. Here are steps I sent to the THG group (slightly clarified from my previous steps:
Steps to reproduce using TortoiseHg:
1. Pick a committed file with a significant revision history
2. Right click on file and under TortoiseHg, rename the file from one directory to a new one (with renaming the file also is what I tried in my testing)
3. Commit the changes
4. Compress the new changes onto a base revision to create a new changeset. Alternatively: also rebase the changeset on the base revision (with the same results)
5. Optional if used compress: Strip the original changeset that was compressed (that is no longer needed)
6. Notice that the old revision history is missing from the file (and there is only 1 changeset instead of the full revision history with multiple changesets)
________________________________
This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
More information about the Mercurial
mailing list