[PATCH] largefiles: fix revert on missing largefile (issue3217)

Na'Tosha Bard natosha at unity3d.com
Wed Jan 25 09:52:58 CST 2012


# HG changeset patch
# User Na'Tosha Bard <natosha at unity3d.com>
# Date 1327506736 -3600
# Branch stable
# Node ID 041be4a0e97bf224c78eb9871afe33aac02e3a26
# Parent  841d574c2f911c1c6465d36c83ccc25829553c10
largefiles: fix revert on missing largefile (issue3217)

diff -r 841d574c2f91 -r 041be4a0e97b hgext/largefiles/overrides.py
--- 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')]
diff -r 841d574c2f91 -r 041be4a0e97b tests/test-largefiles.t
--- 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


More information about the Mercurial-devel mailing list