hgext/largefiles/lfutil.py
branchstable
changeset 18490 877f80599df0
parent 18300 745bc16ccef2
child 18724 894a5897a9dd
equal deleted inserted replaced
18489:f1700480bef7 18490:877f80599df0
   222 
   222 
   223 def getstandinmatcher(repo, pats=[], opts={}):
   223 def getstandinmatcher(repo, pats=[], opts={}):
   224     '''Return a match object that applies pats to the standin directory'''
   224     '''Return a match object that applies pats to the standin directory'''
   225     standindir = repo.wjoin(shortname)
   225     standindir = repo.wjoin(shortname)
   226     if pats:
   226     if pats:
   227         # patterns supplied: search standin directory relative to current dir
   227         pats = [os.path.join(standindir, pat) for pat in pats]
   228         cwd = repo.getcwd()
       
   229         if os.path.isabs(cwd):
       
   230             # cwd is an absolute path for hg -R <reponame>
       
   231             # work relative to the repository root in this case
       
   232             cwd = ''
       
   233         pats = [os.path.join(standindir, cwd, pat) for pat in pats]
       
   234     elif os.path.isdir(standindir):
   228     elif os.path.isdir(standindir):
   235         # no patterns: relative to repo root
   229         # no patterns: relative to repo root
   236         pats = [standindir]
   230         pats = [standindir]
   237     else:
   231     else:
   238         # no patterns and no standin dir: return matcher that matches nothing
   232         # no patterns and no standin dir: return matcher that matches nothing