comparison mercurial/scmutil.py @ 15797:c7a8164c61ab

canonpath: allow canonicalization of non-existant paths Such as a copy destination; see the added test.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 08 Jan 2012 15:23:26 +0100
parents 5b384b7f48d5
children 0b05e0bfdc1c
comparison
equal deleted inserted replaced
15796:3e5b6045ccfc 15797:c7a8164c61ab
311 rel = [] 311 rel = []
312 while True: 312 while True:
313 try: 313 try:
314 name_st = os.stat(name) 314 name_st = os.stat(name)
315 except OSError: 315 except OSError:
316 break 316 name_st = None
317 if util.samestat(name_st, root_st): 317 if name_st and util.samestat(name_st, root_st):
318 if not rel: 318 if not rel:
319 # name was actually the same as root (maybe a symlink) 319 # name was actually the same as root (maybe a symlink)
320 return '' 320 return ''
321 rel.reverse() 321 rel.reverse()
322 name = os.path.join(*rel) 322 name = os.path.join(*rel)