Tracking base revision for files distributed without a repo

Benjamin Fritz fritzophrenic at gmail.com
Thu Jan 23 21:11:51 UTC 2014


On Thu, Jan 23, 2014 at 2:19 PM, Matt Mackall <mpm at selenic.com> wrote:
>
> On Wed, 2014-01-22 at 23:47 -0600, Benjamin Fritz wrote:
>> But when they occasionally email me back a modified copy of the script
>> to fix a bug or expand the types of data it can handle, I'd really
>> like to know where to start when merging in changes.
>
> Ideally, there'd be a way to ask Mercurial "which revision of file X is
> closest to this copy here?"
>

Yes, exactly! I don't really NEED the revision recorded somewhere if
it easy to find the revision with the easiest merge.

> Here's one way to do that on the command line (using the file 'hg'):
>
> $ for x in `hg log hg --template "{rev}\n"`; do echo -n "$x "; hg diff
> -r $x hg | wc -l ; done

So this will basically print each revision followed by the number of
lines that differ from that revision to the file currently in the
working copy, correct? That could work. Of course I use Windows so
I'll need to tweak that. Although, I'd definitely prefer to use a
simpler command.



More information about the Mercurial mailing list