largefiles: fix addremove when largefile is missing (issue3227)
authorNa'Tosha Bard <natosha@unity3d.com>
Sun, 13 May 2012 12:11:50 +0200
changeset 16731 dcfc70aab372
parent 16730 dd4ce44ff53c
child 16732 277e2acb7e5c
largefiles: fix addremove when largefile is missing (issue3227)
hgext/largefiles/overrides.py
hgext/largefiles/reposetup.py
--- a/hgext/largefiles/overrides.py	Sun May 13 12:01:52 2012 +0200
+++ b/hgext/largefiles/overrides.py	Sun May 13 12:11:50 2012 +0200
@@ -169,6 +169,8 @@
         # function handle this.
         if not getattr(repo, "_isaddremove", False):
             lfutil.reporemove(repo, remove, unlink=True)
+        else:
+            lfutil.reporemove(repo, remove, unlink=False)
     finally:
         wlock.release()
 
--- a/hgext/largefiles/reposetup.py	Sun May 13 12:01:52 2012 +0200
+++ b/hgext/largefiles/reposetup.py	Sun May 13 12:11:50 2012 +0200
@@ -340,8 +340,9 @@
                                     lfdirstate.normal(lfile)
                     for lfile in lfdirstate:
                         if lfile in modifiedfiles:
-                            if not os.path.exists(
-                                    repo.wjoin(lfutil.standin(lfile))):
+                            if (not os.path.exists(repo.wjoin(
+                               lfutil.standin(lfile)))) or \
+                               (not os.path.exists(repo.wjoin(lfile))):
                                 lfdirstate.drop(lfile)
 
                     result = orig(text=text, user=user, date=date, match=match,