File History vs. Path History
Paul Mensonides
pmenso57 at comcast.net
Sat Jan 19 10:30:01 UTC 2013
On Sat, 19 Jan 2013 10:02:47 +0100, Christophe HENRY wrote:
> Le Sat, 19 Jan 2013 08:17:31 +0000 (UTC) Paul Mensonides
> <pmenso57 at comcast.net> a écrit :
>
>> Hi all.
>>
>> Is it possible to extract a history for a particular file as opposed to
>> a particular path? For example,
>> (...)
>
> In a nutshell, how can we use the SVN's peg revision in Mercurial?
Basically, yes.
I maintain a propriety software project for a company. The source for the
software is in a Mercurial repository, and all is well. I have a weirder
use case that isn't really related to normal source control.
The files (XML) created *by* the software are stored in a separate
Mercurial repository. These files refer to one another. E.g. one file
can refer to the (full) node-id and path of another file. (The reference
also contains a collection of inputs required by the import.) Normally,
these files go into the repository and are not changed unless they have
errors (essentially, the files contain geometric data used to automate
machinery). Changing a file can potentially change the inputs required by
an import of the file (so I can't just automatically use the most recent
revision).
When the software loads one of these files, it resolves the references to
other files contained therein (i.e. hg cat with a particular node-id and
path). What I want to do is detect whether newer revisions of the file
exist and issue an "outdated" error if there are.
However, there are semi-rare cases where a file is revised for reasons
other than a bug fix (i.e. adding some newly needed feature). What I was
expecting is that I would simply do something like:
cp file temp
// ... edit temp ...
hg rm file
mv temp file
hg add file
hg ci -m "replaced file with new file"
Then given a node-id/path in a file, I could somehow track forward to
detect new revisions, but that tracking forward would not pass the hg rm
revision (because the file after that is a new different file).
Is this possible?
Regards,
Paul Mensonides
More information about the Mercurial
mailing list