--- a/mercurial/cmdutil.py Thu May 02 20:41:22 2013 -0500
+++ b/mercurial/cmdutil.py Fri May 03 15:34:18 2013 -0500
@@ -2055,6 +2055,12 @@
checkout(f)
normal(f)
+ copied = copies.pathcopies(repo[parent], ctx)
+
+ for f in add[0] + undelete[0] + revert[0]:
+ if f in copied:
+ repo.dirstate.copy(copied[f], f)
+
if targetsubs:
# Revert the subrepos on the revert list
for sub in targetsubs:
--- a/mercurial/dirstate.py Thu May 02 20:41:22 2013 -0500
+++ b/mercurial/dirstate.py Fri May 03 15:34:18 2013 -0500
@@ -700,7 +700,7 @@
for nf in iter(visit):
# Report ignored items in the dmap as long as they are not
# under a symlink directory.
- if ignore(nf) and audit_path.check(nf):
+ if audit_path.check(nf):
try:
results[nf] = lstat(join(nf))
except OSError:
--- a/tests/test-hgignore.t Thu May 02 20:41:22 2013 -0500
+++ b/tests/test-hgignore.t Fri May 03 15:34:18 2013 -0500
@@ -124,3 +124,13 @@
(?:(?:|.*/)[^/]*(?:/|$))
$ cd ..
+
+Check patterns that match only the directory
+
+ $ echo "^dir\$" > .hgignore
+ $ hg status
+ A dir/b.o
+ ? .hgignore
+ ? a.c
+ ? a.o
+ ? syntax
--- a/tests/test-revert.t Thu May 02 20:41:22 2013 -0500
+++ b/tests/test-revert.t Fri May 03 15:34:18 2013 -0500
@@ -275,4 +275,28 @@
$ hg revert --no-backup ignored removed
$ hg st -mardi
+someone set up us the copies
+
+ $ rm .hgignore
+ $ hg update -C
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg mv ignored allyour
+ $ hg copy removed base
+ $ hg commit -m rename
+
+copies and renames, you have no chance to survive make your time (issue3920)
+
+ $ hg update '.^'
+ 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ hg revert -rtip -a
+ adding allyour
+ adding base
+ removing ignored
+ $ hg status -C
+ A allyour
+ ignored
+ A base
+ removed
+ R ignored
+
$ cd ..