comparison mercurial/patch.py @ 6531:c2c4fa9af016

merge with -stable
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 12 Apr 2008 23:05:51 -0400
parents ac0bcd951c2c ba0b2dacc623
children 833be17000b6
comparison
equal deleted inserted replaced
6530:4b92591c69a7 6531:c2c4fa9af016
787 def selectfile(afile_orig, bfile_orig, hunk, strip, reverse): 787 def selectfile(afile_orig, bfile_orig, hunk, strip, reverse):
788 def pathstrip(path, count=1): 788 def pathstrip(path, count=1):
789 pathlen = len(path) 789 pathlen = len(path)
790 i = 0 790 i = 0
791 if count == 0: 791 if count == 0:
792 return path.rstrip() 792 return '', path.rstrip()
793 while count > 0: 793 while count > 0:
794 i = path.find('/', i) 794 i = path.find('/', i)
795 if i == -1: 795 if i == -1:
796 raise PatchError(_("unable to strip away %d dirs from %s") % 796 raise PatchError(_("unable to strip away %d dirs from %s") %
797 (count, path)) 797 (count, path))