tests/test-revert-flags.t
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 23 Dec 2014 16:12:54 -0800
changeset 23663 a9853fc172d2
parent 22046 7a9cbb315d84
permissions -rw-r--r--
trydiff: simplify checking for additions In the body of the loop in trydiff(), there are conditions like: addedset or (f in modifiedset and to is None) The second half of that expression is to account for the fact that merge-in additions appear as additions. By instead fixing up the sets of modified and added files to compensate for this fact, we can simplify the body of the loop. It also fixes one case where the addedset was checked without the additional check (the "have we already reported a copy above?" case in the code, also see fixed test case). The similar condition with 'removedset' in it seems to have served no purpose even before this change, so it could have been simplified even before.

#require execbit

  $ hg init repo
  $ cd repo
  $ echo foo > foo
  $ chmod 644 foo
  $ hg ci -qAm '644'

  $ chmod 755 foo
  $ hg ci -qAm '755'

reverting to rev 0

  $ hg revert -a -r 0
  reverting foo
  $ hg st
  M foo
  $ hg diff --git
  diff --git a/foo b/foo
  old mode 100755
  new mode 100644

  $ cd ..