0

To get a list of changes, this answer gives the command line:

hg status --change REV

But calling status using hglib gives an error:

>>> client.status(rev=-1, change=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\asdf\envs\stackoverflow\lib\site-packages\hglib\client.py", line 1384, in status
    raise ValueError('cannot specify both rev and change')
ValueError: cannot specify both rev and change

Why can't we specify both rev and change?

In answer to another recent question, I posted:

client.status(rev=[start, end], modified=True, added=True)

This works, but I was wondering why the other doesn't. What am I missing?

Community
  • 1
  • 1
Peter Wood
  • 23,859
  • 5
  • 60
  • 99

1 Answers1

2

hg status --change REV only specifies the --change flag, not the --rev flag.

The --change REV option displays the changes introduced with changeset REV. The --rev REV options displays the changes between the changeset REV and the working directory.

If you try hg status --change REVx --rev REVy, you'll have the same error that you see with client.status(rev=-1, change=True) Both the change and rev options take changesets as parameters

Note that --modified is different to --change REV - the filters the output to show modified files only.

Sigve Kolbeinson
  • 1,133
  • 1
  • 7
  • 16
  • Ah! So, I should be passing `client.status(change=[start, end])`. That's great. Thank you. It works! – Peter Wood Sep 02 '15 at 13:22
  • @Peter Wood When I do that from the command line, `hg status --change start:end` is the same as `hg status --change end`, that is, the changes in `end` relative to its parent. `hg status --rev start:end` shows the changes between `start` and `end`. Or put differently `hg status --change X` is equivalent to `hg status --rev X-1:X`. Does `client.status( rev=[start,end])` also work? – Sigve Kolbeinson Sep 02 '15 at 13:31
  • I don't have time to check now, but will get back to you. – Peter Wood Sep 02 '15 at 14:13