Patchwork [9,of,9,stable] largefiles: updatelfiles should use working dir standins, not standins from p1

login
register
mail settings
Submitter Mads Kiilerich
Date Feb. 26, 2013, 2:41 a.m.
Message ID <bc8da215c814c01d5115.1361846489@mk-desktop>
Download mbox | patch
Permalink /patch/1055/
State Accepted
Commit 4e53ac3f466a7d36c957de76b39b0daeb8feaca9
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 bc8da215c814c01d51159593304c0a746246cf33
# Parent  fba3b0f812f9f5db45e03b2bdce12ec7d9b71c79
largefiles: updatelfiles should use working dir standins, not standins from p1

This makes a difference when working directory is dirty, especially when
merging with a revision for which we don't have largefiles.

Patch

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -450,7 +450,7 @@ 
         if printmessage and lfiles:
             ui.status(_('getting changed largefiles\n'))
             printed = True
-            cachelfiles(ui, repo, '.', lfiles)
+            cachelfiles(ui, repo, None, lfiles)
 
         updated, removed = 0, 0
         for f in lfiles:
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -1298,6 +1298,25 @@ 
   repository tip rolled back to revision 9 (undo commit)
   working directory now based on revision 6
 
+Merge with revision with missing largefile - and make sure it tries to fetch it.
+
+  $ hg up -Cqr null
+  $ echo f > f
+  $ hg ci -Am branch
+  adding f
+  Invoking status precommit hook
+  A f
+  created new head
+  $ hg merge -r 6
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob)
+  1 largefiles updated, 0 removed
+
+  $ hg rollback -q
+  $ hg up -Cq
+
 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
 
   $ hg pull --all-largefiles