[PATCH 1 of 2] largefiles: file storage should be relative to repo, not relative to cwd

Mads Kiilerich mads at kiilerich.com
Tue Nov 22 12:56:53 CST 2011


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1321987943 -3600
# Branch stable
# Node ID 3fc2ccb2faef23ecf59f76fd93329a7b7c17b256
# Parent  f76584098c88fadcb74a8aa5c9c7efb2fb25b682
largefiles: file storage should be relative to repo, not relative to cwd

Revealed by the test in 1fd126cd2d91.

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -156,7 +156,7 @@
             hash = readstandin(repo, lfile)
             lfdirstate.normallookup(lfile)
             try:
-                if hash == hashfile(lfile):
+                if hash == hashfile(repo.wjoin(lfile)):
                     lfdirstate.normal(lfile)
             except OSError, err:
                 if err.errno != errno.ENOENT:
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -257,6 +257,12 @@
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  $ hg debugstate --nodates
+  n 644         41 .hglf/sub/large4
+  n   0         -1 .hglf/sub2/large6
+  n   0         -1 .hglf/sub2/large7
+  n 644          9 normal3
+  n 644          9 sub/normal4
   $ cd ../b
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   7:daea875e9014  add/edit more largefiles


More information about the Mercurial-devel mailing list