Patchwork D5922: largefiles: get cwd and relative paths from repo instead of matcher

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2019, 1:59 a.m.
Message ID <1d31be21ecbc5cfc6bf60e5f3621d8b0@localhost.localdomain>
Download mbox | patch
Permalink /patch/38653/
State Not Applicable
Headers show

Comments

phabricator - Feb. 11, 2019, 1:59 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8fa1a5fb8a28: largefiles: get cwd and relative paths from repo instead of matcher (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5922?vs=14003&id=14008

REVISION DETAIL
  https://phab.mercurial-scm.org/D5922

AFFECTED FILES
  hgext/largefiles/overrides.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -301,9 +301,10 @@ 
                 return kindpat[0] + ':' + tostandin(kindpat[1])
             return tostandin(kindpat[1])
 
-        if m._cwd:
+        cwd = repo.getcwd()
+        if cwd:
             hglf = lfutil.shortname
-            back = util.pconvert(m.rel(hglf)[:-len(hglf)])
+            back = util.pconvert(repo.pathto(hglf)[:-len(hglf)])
 
             def tostandin(f):
                 # The file may already be a standin, so truncate the back
@@ -316,10 +317,10 @@ 
                 # path to the root before building the standin.  Otherwise cwd
                 # is somewhere in the repo, relative to root, and needs to be
                 # prepended before building the standin.
-                if os.path.isabs(m._cwd):
+                if os.path.isabs(cwd):
                     f = f[len(back):]
                 else:
-                    f = m._cwd + '/' + f
+                    f = cwd + '/' + f
                 return back + lfutil.standin(f)
         else:
             def tostandin(f):