Clean way of extracting rename information from mercurial

Yaron Minsky yminsky at janestcapital.com
Wed Nov 28 11:27:05 CST 2007


On Wed, 2007-11-28 at 08:45 -0800, Brendan Cully wrote:
> On Wednesday, 28 November 2007 at 09:06, Yaron Minsky wrote:
> > Is there a nice way to ask mercurial how files have been renamed between
> > two revisions?  The reason for the question is that we're trying to put
> > together a diff tool that is intelligent about renames, but for now, the
> > only way we've managed to get our hands on the data is to parse through
> > the output of "hg diff --git", which is somewhat error prone.
> 
> you can use hg status -arC --rev <old>:<new>

I just created a repo with a single file "foo" and then renamed it to
bar.  The result of the command you proposed is as follows:
        
        [12:25:02 yminsky at nyc-qws-015 foo]$ hg status -arC --rev 0:1
        A bar
        R foo

That looks like bar was added and foo was removed.  I'm not sure how I
can detect that bar is actually a copy of foo from this.

y

-- 
Yaron Minsky <yminsky at janestcapital.com>



More information about the Mercurial mailing list