##// END OF EJS Templates
revert: prefix variable names for dirstate status with "ds"...
Pierre-Yves David -
r22154:fc422de2 default
parent child Browse files
Show More
@@ -2369,14 +2369,14 b' def revert(ui, repo, ctx, parents, *pats'
2369 # Find status of all file in `names`. (Against working directory parent)
2369 # Find status of all file in `names`. (Against working directory parent)
2370 m = scmutil.matchfiles(repo, names)
2370 m = scmutil.matchfiles(repo, names)
2371 changes = repo.status(node1=parent, match=m)[:4]
2371 changes = repo.status(node1=parent, match=m)[:4]
2372 modified, added, removed, deleted = map(set, changes)
2372 dsmodified, dsadded, dsremoved, dsdeleted = map(set, changes)
2373
2373
2374 # if f is a rename, update `names` to also revert the source
2374 # if f is a rename, update `names` to also revert the source
2375 cwd = repo.getcwd()
2375 cwd = repo.getcwd()
2376 for f in added:
2376 for f in dsadded:
2377 src = repo.dirstate.copied(f)
2377 src = repo.dirstate.copied(f)
2378 if src and src not in names and repo.dirstate[src] == 'r':
2378 if src and src not in names and repo.dirstate[src] == 'r':
2379 removed.add(src)
2379 dsremoved.add(src)
2380 names[src] = (repo.pathto(src, cwd), True)
2380 names[src] = (repo.pathto(src, cwd), True)
2381
2381
2382 ## computation of the action to performs on `names` content.
2382 ## computation of the action to performs on `names` content.
@@ -2389,14 +2389,14 b' def revert(ui, repo, ctx, parents, *pats'
2389 # split between files known in target manifest and the others
2389 # split between files known in target manifest and the others
2390 smf = set(mf)
2390 smf = set(mf)
2391
2391
2392 missingmodified = modified - smf
2392 missingmodified = dsmodified - smf
2393 modified -= missingmodified
2393 dsmodified -= missingmodified
2394 missingadded = added - smf
2394 missingadded = dsadded - smf
2395 added -= missingadded
2395 dsadded -= missingadded
2396 missingremoved = removed - smf
2396 missingremoved = dsremoved - smf
2397 removed -= missingremoved
2397 dsremoved -= missingremoved
2398 missingdeleted = deleted - smf
2398 missingdeleted = dsdeleted - smf
2399 deleted -= missingdeleted
2399 dsdeleted -= missingdeleted
2400
2400
2401 # action to be actually performed by revert
2401 # action to be actually performed by revert
2402 # (<list of file>, message>) tuple
2402 # (<list of file>, message>) tuple
@@ -2410,13 +2410,13 b' def revert(ui, repo, ctx, parents, *pats'
2410 # file state
2410 # file state
2411 # action
2411 # action
2412 # make backup
2412 # make backup
2413 (modified, (actions['revert'], True)),
2413 (dsmodified, (actions['revert'], True)),
2414 (missingmodified, (actions['remove'], True)),
2414 (missingmodified, (actions['remove'], True)),
2415 (added, (actions['revert'], True)),
2415 (dsadded, (actions['revert'], True)),
2416 (missingadded, (actions['remove'], False)),
2416 (missingadded, (actions['remove'], False)),
2417 (removed, (actions['undelete'], True)),
2417 (dsremoved, (actions['undelete'], True)),
2418 (missingremoved, (None, False)),
2418 (missingremoved, (None, False)),
2419 (deleted, (actions['revert'], False)),
2419 (dsdeleted, (actions['revert'], False)),
2420 (missingdeleted, (actions['remove'], False)),
2420 (missingdeleted, (actions['remove'], False)),
2421 )
2421 )
2422
2422
General Comments 0
You need to be logged in to leave comments. Login now