largefiles: fix revert on missing largefile (issue3217) stable
authorNa'Tosha Bard <natosha@unity3d.com>
Wed, 25 Jan 2012 16:52:16 +0100
branchstable
changeset 15983 32b9aee3602c
parent 15982 bf502ccc46d7
child 15984 894f83a35653
largefiles: fix revert on missing largefile (issue3217)
hgext/largefiles/overrides.py
tests/test-largefiles.t
--- a/hgext/largefiles/overrides.py	Wed Jan 25 14:10:01 2012 +0100
+++ b/hgext/largefiles/overrides.py	Wed Jan 25 16:52:16 2012 +0100
@@ -535,6 +535,8 @@
             lfutil.lfdirstate_status(lfdirstate, repo, repo['.'].rev())
         for lfile in modified:
             lfutil.updatestandin(repo, lfutil.standin(lfile))
+        for lfile in missing:
+            os.unlink(repo.wjoin(lfutil.standin(lfile)))
 
         try:
             ctx = repo[opts.get('rev')]
--- a/tests/test-largefiles.t	Wed Jan 25 14:10:01 2012 +0100
+++ b/tests/test-largefiles.t	Wed Jan 25 16:52:16 2012 +0100
@@ -564,6 +564,8 @@
   $ echo hack3 >> normal3
   $ echo hack4 >> sub/normal4
   $ echo hack4 >> sub/large4
+  $ rm sub2/large6
+  $ hg revert sub2/large6
   $ hg rm sub2/large6
   $ echo new >> sub2/large8
   $ hg add --large sub2/large8