##// END OF EJS Templates
patch: use set instead of dict
Benoit Boissinot -
r8461:88f317e7 default
parent child Browse files
Show More
@@ -1033,7 +1033,7 b' def updatedir(ui, repo, patches, similar'
1033 if not patches:
1033 if not patches:
1034 return
1034 return
1035 copies = []
1035 copies = []
1036 removes = {}
1036 removes = set()
1037 cfiles = patches.keys()
1037 cfiles = patches.keys()
1038 cwd = repo.getcwd()
1038 cwd = repo.getcwd()
1039 if cwd:
1039 if cwd:
@@ -1044,14 +1044,13 b' def updatedir(ui, repo, patches, similar'
1044 continue
1044 continue
1045 if gp.op == 'RENAME':
1045 if gp.op == 'RENAME':
1046 copies.append((gp.oldpath, gp.path))
1046 copies.append((gp.oldpath, gp.path))
1047 removes[gp.oldpath] = 1
1047 removes.add(gp.oldpath)
1048 elif gp.op == 'COPY':
1048 elif gp.op == 'COPY':
1049 copies.append((gp.oldpath, gp.path))
1049 copies.append((gp.oldpath, gp.path))
1050 elif gp.op == 'DELETE':
1050 elif gp.op == 'DELETE':
1051 removes[gp.path] = 1
1051 removes.add(gp.path)
1052 for src, dst in copies:
1052 for src, dst in copies:
1053 repo.copy(src, dst)
1053 repo.copy(src, dst)
1054 removes = removes.keys()
1055 if (not similarity) and removes:
1054 if (not similarity) and removes:
1056 repo.remove(sorted(removes), True)
1055 repo.remove(sorted(removes), True)
1057 for f in patches:
1056 for f in patches:
@@ -1240,7 +1239,7 b' def diff(repo, node1=None, node2=None, m'
1240 for k, v in copy.items():
1239 for k, v in copy.items():
1241 copy[v] = k
1240 copy[v] = k
1242
1241
1243 gone = {}
1242 gone = set()
1244 gitmode = {'l': '120000', 'x': '100755', '': '100644'}
1243 gitmode = {'l': '120000', 'x': '100755', '': '100644'}
1245
1244
1246 for f in sorted(modified + added + removed):
1245 for f in sorted(modified + added + removed):
@@ -1262,7 +1261,7 b' def diff(repo, node1=None, node2=None, m'
1262 _addmodehdr(header, omode, mode)
1261 _addmodehdr(header, omode, mode)
1263 if a in removed and a not in gone:
1262 if a in removed and a not in gone:
1264 op = 'rename'
1263 op = 'rename'
1265 gone[a] = 1
1264 gone.add(a)
1266 else:
1265 else:
1267 op = 'copy'
1266 op = 'copy'
1268 header.append('%s from %s\n' % (op, a))
1267 header.append('%s from %s\n' % (op, a))
General Comments 0
You need to be logged in to leave comments. Login now