[PATCH stable] largefiles: better handling of log from other working directory (issue4236)

Mads Kiilerich mads at kiilerich.com
Thu May 1 08:45:37 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1398949969 -7200
#      Thu May 01 15:12:49 2014 +0200
# Branch stable
# Node ID 21117a903d7a8cbde799b5d06ae391cd6fe08c75
# Parent  e2031c8ca4f8939a21fea454cb64b7a2744d9c8d
largefiles: better handling of log from other working directory (issue4236)

When invoked from another directory, the matchers m._cwd will be the absolute
path. The code for calculating relative path to .hglf did not consider that and
log would fail with weird errors and paths.

For now, just don't do any largefile magic when invoked from other directories.

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -270,6 +270,9 @@ def overridelog(orig, ui, repo, *pats, *
         pats = set(p)
         # TODO: handling of patterns in both cases below
         if m._cwd:
+            if os.path.isabs(m._cwd):
+                # TODO: handle largefile magic when invoked from other cwd
+                return matchandpats
             back = (m._cwd.count('/') + 1) * '../'
             pats.update(back + lfutil.standin(m._cwd + '/' + f) for f in p)
         else:
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -773,6 +773,18 @@ Test graph log
   @  7:daea875e9014
   |
   $ cd ..
+
+Test log from outside repo
+
+  $ hg log  b/sub -T '{rev}:{node|short}  {desc|firstline}\n'
+  6
+  5
+  4
+  1
+  0
+
+Test clone at revision
+
   $ hg clone a -r 3 c
   adding changesets
   adding manifests


More information about the Mercurial-devel mailing list