0

I want a simple command to get the list of files which differ after pushing to a mercurial repository on a server, that is the differences between the previous push and the current push. On the server, I have a hook on the changegroup event which calls a bash script. $HG_NODE is the revision for the first commit in the changegroup.

My attempts:

hg status --rev $HG_NODE::

Exclude changes made in the first commit

hg status --rev $HG_NODE^1::

Includes changes that affected the parent revision through others pushes.

hg log -v --rev $HG_NODE:: | grep ^files

Include committed then reverted changes, still has 'files:' and files are not one per line

hg status --rev $HG_NODE:: && hg status change --rev $HG_NODE

Does not give exactly what I want, rather the change between the parent to the first commit in the changegroup + the change between this one (instead of the two changesets merged)

hg status --rev some_tag ; hg tag --remove some_tag ; hg tag --local some_tag

(Have not tried, is it a good idea?) Uses a local tag to keep track of the head for the last push, updates it each time.

Also I want to only monitor the default branch, so I assume I will use something like --rev "revision and branch(default)" or the branch option for hg log.

As to why, I need to go through the changes to determine parameters for an automated build.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81

1 Answers1

0

hg stat -r is to list the removed files. To get the list of files which differ, you should use hg st --rev as follows.

hg st -m --rev tip^:tip
Arun
  • 1,399
  • 12
  • 21
  • My bad, I was actually already using --rev, I used -r in the post to shorten the code thinking it would be the same (I fixed it). I already tried with ^, but the revision parent for my case may not be the same as the previous tip – user5025843 Jun 19 '15 at 09:59