equal
deleted
inserted
replaced
299 |
299 |
300 if kindpat[0] is not None: |
300 if kindpat[0] is not None: |
301 return kindpat[0] + ':' + tostandin(kindpat[1]) |
301 return kindpat[0] + ':' + tostandin(kindpat[1]) |
302 return tostandin(kindpat[1]) |
302 return tostandin(kindpat[1]) |
303 |
303 |
304 if m._cwd: |
304 cwd = repo.getcwd() |
|
305 if cwd: |
305 hglf = lfutil.shortname |
306 hglf = lfutil.shortname |
306 back = util.pconvert(m.rel(hglf)[:-len(hglf)]) |
307 back = util.pconvert(repo.pathto(hglf)[:-len(hglf)]) |
307 |
308 |
308 def tostandin(f): |
309 def tostandin(f): |
309 # The file may already be a standin, so truncate the back |
310 # The file may already be a standin, so truncate the back |
310 # prefix and test before mangling it. This avoids turning |
311 # prefix and test before mangling it. This avoids turning |
311 # 'glob:../.hglf/foo*' into 'glob:../.hglf/../.hglf/foo*'. |
312 # 'glob:../.hglf/foo*' into 'glob:../.hglf/../.hglf/foo*'. |
314 |
315 |
315 # An absolute path is from outside the repo, so truncate the |
316 # An absolute path is from outside the repo, so truncate the |
316 # path to the root before building the standin. Otherwise cwd |
317 # path to the root before building the standin. Otherwise cwd |
317 # is somewhere in the repo, relative to root, and needs to be |
318 # is somewhere in the repo, relative to root, and needs to be |
318 # prepended before building the standin. |
319 # prepended before building the standin. |
319 if os.path.isabs(m._cwd): |
320 if os.path.isabs(cwd): |
320 f = f[len(back):] |
321 f = f[len(back):] |
321 else: |
322 else: |
322 f = m._cwd + '/' + f |
323 f = cwd + '/' + f |
323 return back + lfutil.standin(f) |
324 return back + lfutil.standin(f) |
324 else: |
325 else: |
325 def tostandin(f): |
326 def tostandin(f): |
326 if lfutil.isstandin(f): |
327 if lfutil.isstandin(f): |
327 return f |
328 return f |