[PATCH 3 of 3 STABLE] largefiles: fix a spurious missing file warning with forget (issue4053)

Matt Harbison mharbison72 at gmail.com
Sun Dec 21 23:39:19 CST 2014


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1419192414 18000
#      Sun Dec 21 15:06:54 2014 -0500
# Branch stable
# Node ID 3ba86b583d6ff00407f3ae008c201704f8ac4fcc
# Parent  d0b7d51a41cc3d0a4e712d52697f2e2e4ce548e9
largefiles: fix a spurious missing file warning with forget (issue4053)

If an uncommitted and deleted file was forgotten, a warning would be emitted,
even though the operation was successful.  See the previous patch for
'remove -A' for the exact circumstances, and details about the cause.

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1008,7 +1008,8 @@
     installnormalfilesmatchfn(repo[None].manifest())
     result = orig(ui, repo, *pats, **opts)
     restorematchfn()
-    m = scmutil.match(repo[None], pats, opts)
+    m = composelargefilematcher(scmutil.match(repo[None], pats, opts),
+                                repo[None].manifest())
 
     try:
         repo.lfstatus = True
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -136,7 +136,8 @@
 #endif
 
 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
-it is missing, but a remove on a nonexistant unknown file still should)
+it is missing, but a remove on a nonexistant unknown file still should.  Same
+for a forget.)
 
   $ cd src
   $ touch x
@@ -146,3 +147,9 @@
   ENOENT: * (glob)
   not removing y: file is untracked
   [1]
+  $ hg add y
+  $ mv y z
+  $ hg forget y z ENOENT
+  ENOENT: * (glob)
+  not removing z: file is already untracked
+  [1]


More information about the Mercurial-devel mailing list