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

login
register
mail settings
Submitter Mads Kiilerich
Date May 1, 2014, 1:45 p.m.
Message ID <21117a903d7a8cbde799.1398951937@mk-desktop>
Download mbox | patch
Permalink /patch/4461/
State Accepted
Commit c5d35995d1926ccffbb0e3663ea1bf71288bf767
Headers show

Comments

Mads Kiilerich - May 1, 2014, 1:45 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.
Matt Mackall - May 1, 2014, 3:48 p.m.
On Thu, 2014-05-01 at 15:45 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@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)

Queued for stable, thanks.

Patch

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