Patchwork [4,of,9,stable] largefiles: getstandinmatcher should not depend on existence of directories

login
register
mail settings
Submitter Mads Kiilerich
Date Feb. 26, 2013, 2:41 a.m.
Message ID <87111ec96b62e837a018.1361846484@mk-desktop>
Download mbox | patch
Permalink /patch/1051/
State Accepted
Commit 894a5897a9dd457c148447f1f71aab020d13eb75
Headers show

Comments

Mads Kiilerich - Feb. 26, 2013, 2:41 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1361846443 -3600
# Branch stable
# Node ID 87111ec96b62e837a018a753e35371afb8240aa8
# Parent  c92e62e6b93838c00c749e85e4eab243e155dd58
largefiles: getstandinmatcher should not depend on existence of directories

Looking for a (potentially empty) directory was not reliable - both because it
is a reasonable assumption that empty directories can be removed and because it
wasn't created in all cases ... such as when pulling to an existing repository.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -225,13 +225,9 @@ 
     standindir = repo.wjoin(shortname)
     if pats:
         pats = [os.path.join(standindir, pat) for pat in pats]
-    elif os.path.isdir(standindir):
+    else:
         # no patterns: relative to repo root
         pats = [standindir]
-    else:
-        # no patterns and no standin dir: return matcher that matches nothing
-        return match_.match(repo.root, None, [], exact=True)
-
     # no warnings about missing files or directories
     match = scmutil.match(repo[None], pats, opts)
     match.bad = lambda f, msg: None
diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -31,6 +31,8 @@ 
   foo has been turned into a largefile
   use (l)argefile or keep as (n)ormal file? 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
 
   $ hg status
   $ cat foo
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
@@ -73,6 +73,20 @@ 
   ! large
   $ cd ..
 
+Verify that largefiles from pulled branchheads are fetched, also to an empty repo
+
+  $ hg init mirror2
+  $ hg -R mirror2 pull src -r0
+  pulling from src
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  caching new largefiles
+  abort: *: '$TESTTMP/mirror2/.hg/largefiles/.7f7097b041ccf68cc5561e9600da4655d21c6d18.*' (glob)
+  [255]
+
 #if unix-permissions
 
 Portable way to print file permissions: