Get list of files added/modified/deleted from specific revision

Dave Mateer dave_mateer at ntm.org
Tue Jun 2 15:58:49 CDT 2009


We are using Mercurial to share Xml data files between
sometimes-connected users. The Xml files are generated from a relational
database, and upon an "hg pull", the relational database is updated
based on the changes in the Xml files.

 

For the current user, I know the last changeset that was a result of an
update from the relational database. What I want to find out is, after
all the hg pull / merge / commit is complete, what files to I need to
update from the repository into the relational database?

 

I'm new to Mercurial, so I'm running this solution sketch past you
experts to let me know of (a) easier ways, (b) pitfalls to avoid, (c)
why this won't work, etc.

 

First, I convert the changesetid of the last revision from the database
into a local revision number. (The changeset id is stored in the
database.) Suppose that resolves to "3".

 

Then I am running:

hg log -r3:tip --template '{files}\n' 

 

I can then parse that output, eliminate duplicates, and voila! I have
the files I need to read and update the relational database with.

 

Or do I? It looks like I'm getting files from the other user's tree,
which is good. But somehow this seems too easy.

 

Any feedback? I appreciate it!

 

Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20090602/0ed13f6b/attachment.htm 


More information about the Mercurial mailing list