equal
deleted
inserted
replaced
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)) |