merge with stable
authorMatt Mackall <mpm@selenic.com>
Mon, 05 Jan 2015 15:46:14 -0600
changeset 23726 d944492445fa
parent 23725 6a81f88758aa (current diff)
parent 23724 aafeaba22826 (diff)
child 23727 987ef74d8d01
merge with stable
hgext/largefiles/overrides.py
mercurial/revset.py
tests/test-largefiles-misc.t
--- a/hgext/largefiles/overrides.py	Mon Jan 05 11:02:04 2015 +0900
+++ b/hgext/largefiles/overrides.py	Mon Jan 05 15:46:14 2015 -0600
@@ -201,12 +201,10 @@
             if not opts.get('dry_run'):
                 if not after:
                     util.unlinkpath(repo.wjoin(f), ignoremissing=True)
-                lfdirstate.remove(f)
 
         if opts.get('dry_run'):
             return result
 
-        lfdirstate.write()
         remove = [lfutil.standin(f) for f in remove]
         # If this is being called by addremove, let the original addremove
         # function handle this.
@@ -214,6 +212,12 @@
             for f in remove:
                 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
         repo[None].forget(remove)
+
+        for f in remove:
+            lfutil.synclfdirstate(repo, lfdirstate, lfutil.splitstandin(f),
+                                  False)
+
+        lfdirstate.write()
     finally:
         wlock.release()
 
--- a/mercurial/revset.py	Mon Jan 05 11:02:04 2015 +0900
+++ b/mercurial/revset.py	Mon Jan 05 15:46:14 2015 -0600
@@ -254,7 +254,7 @@
     x = repo[x].rev()
     if x == -1 and len(subset) == len(repo):
         return baseset([-1])
-    if len(subset) == len(repo) or x in subset:
+    if x in subset:
         return baseset([x])
     return baseset()
 
--- a/tests/test-largefiles-misc.t	Mon Jan 05 11:02:04 2015 +0900
+++ b/tests/test-largefiles-misc.t	Mon Jan 05 15:46:14 2015 -0600
@@ -255,6 +255,7 @@
 Add a normal file to the subrepo, then test archiving
 
   $ echo 'normal file' > subrepo/normal.txt
+  $ touch large.dat
   $ mv subrepo/large.txt subrepo/renamed-large.txt
   $ hg -R subrepo addremove --dry-run
   removing large.txt
@@ -262,11 +263,19 @@
   adding renamed-large.txt
   $ hg status -S
   ! subrepo/large.txt
+  ? large.dat
   ? subrepo/normal.txt
   ? subrepo/renamed-large.txt
   $ mv subrepo/renamed-large.txt subrepo/large.txt
   $ hg -R subrepo add subrepo/normal.txt
 
+  $ hg addremove
+  adding large.dat as a largefile
+  $ rm large.dat
+
+  $ hg addremove
+  removing large.dat
+
 Lock in subrepo, otherwise the change isn't archived
 
   $ hg ci -S -m "add normal file to top level"