##// END OF EJS Templates
patch: rename pathstrip to pathtransform...
Siddharth Agarwal -
r24242:3acb83c6 default
parent child Browse files
Show More
@@ -1087,7 +1087,7 b' def parsefilename(str):'
1087 1087 return s
1088 1088 return s[:i]
1089 1089
1090 def pathstrip(path, strip):
1090 def pathtransform(path, strip):
1091 1091 pathlen = len(path)
1092 1092 i = 0
1093 1093 if strip == 0:
@@ -1110,9 +1110,9 b' def makepatchmeta(backend, afile_orig, b'
1110 1110 nullb = bfile_orig == "/dev/null"
1111 1111 create = nulla and hunk.starta == 0 and hunk.lena == 0
1112 1112 remove = nullb and hunk.startb == 0 and hunk.lenb == 0
1113 abase, afile = pathstrip(afile_orig, strip)
1113 abase, afile = pathtransform(afile_orig, strip)
1114 1114 gooda = not nulla and backend.exists(afile)
1115 bbase, bfile = pathstrip(bfile_orig, strip)
1115 bbase, bfile = pathtransform(bfile_orig, strip)
1116 1116 if afile == bfile:
1117 1117 goodb = gooda
1118 1118 else:
@@ -1352,7 +1352,7 b' def _applydiff(ui, fp, patcher, backend,'
1352 1352 eolmode='strict'):
1353 1353
1354 1354 def pstrip(p):
1355 return pathstrip(p, strip - 1)[1]
1355 return pathtransform(p, strip - 1)[1]
1356 1356
1357 1357 rejects = 0
1358 1358 err = 0
@@ -1541,9 +1541,9 b' def changedfiles(ui, repo, patchpath, st'
1541 1541 if state == 'file':
1542 1542 afile, bfile, first_hunk, gp = values
1543 1543 if gp:
1544 gp.path = pathstrip(gp.path, strip - 1)[1]
1544 gp.path = pathtransform(gp.path, strip - 1)[1]
1545 1545 if gp.oldpath:
1546 gp.oldpath = pathstrip(gp.oldpath, strip - 1)[1]
1546 gp.oldpath = pathtransform(gp.oldpath, strip - 1)[1]
1547 1547 else:
1548 1548 gp = makepatchmeta(backend, afile, bfile, first_hunk, strip)
1549 1549 changed.add(gp.path)
General Comments 0
You need to be logged in to leave comments. Login now