##// END OF EJS Templates
merge: add merge action 'pr' to rename files during update...
Mark Thomas -
r34549:b4955650 default
parent child Browse files
Show More
@@ -1263,7 +1263,7 b' def applyupdates(repo, actions, wctx, mc'
1263 z += 1
1263 z += 1
1264 progress(_updating, z, item=f, total=numupdates, unit=_files)
1264 progress(_updating, z, item=f, total=numupdates, unit=_files)
1265
1265
1266 # remove in parallel (must come before getting)
1266 # remove in parallel (must come before resolving path conflicts and getting)
1267 prog = worker.worker(repo.ui, 0.001, batchremove, (repo, wctx),
1267 prog = worker.worker(repo.ui, 0.001, batchremove, (repo, wctx),
1268 actions['r'])
1268 actions['r'])
1269 for i, item in prog:
1269 for i, item in prog:
@@ -1271,6 +1271,18 b' def applyupdates(repo, actions, wctx, mc'
1271 progress(_updating, z, item=item, total=numupdates, unit=_files)
1271 progress(_updating, z, item=item, total=numupdates, unit=_files)
1272 removed = len(actions['r'])
1272 removed = len(actions['r'])
1273
1273
1274 # resolve path conflicts (must come before getting)
1275 for f, args, msg in actions['pr']:
1276 repo.ui.debug(" %s: %s -> pr\n" % (f, msg))
1277 f0, = args
1278 if wctx[f0].lexists():
1279 repo.ui.note(_("moving %s to %s\n") % (f0, f))
1280 wctx[f].audit()
1281 wctx[f].write(wctx.filectx(f0).data(), wctx.filectx(f0).flags())
1282 wctx[f0].remove()
1283 z += 1
1284 progress(_updating, z, item=f, total=numupdates, unit=_files)
1285
1274 # We should flush before forking into worker processes, since those workers
1286 # We should flush before forking into worker processes, since those workers
1275 # flush when they complete, and we don't want to duplicate work.
1287 # flush when they complete, and we don't want to duplicate work.
1276 wctx.flushall()
1288 wctx.flushall()
@@ -1443,6 +1455,17 b' def recordupdates(repo, actions, branchm'
1443 for f, args, msg in actions.get('f', []):
1455 for f, args, msg in actions.get('f', []):
1444 repo.dirstate.drop(f)
1456 repo.dirstate.drop(f)
1445
1457
1458 # resolve path conflicts
1459 for f, args, msg in actions.get('pr', []):
1460 f0, = args
1461 origf0 = repo.dirstate.copied(f0) or f0
1462 repo.dirstate.add(f)
1463 repo.dirstate.copy(origf0, f)
1464 if f0 == origf0:
1465 repo.dirstate.remove(f0)
1466 else:
1467 repo.dirstate.drop(f0)
1468
1446 # re-add
1469 # re-add
1447 for f, args, msg in actions.get('a', []):
1470 for f, args, msg in actions.get('a', []):
1448 repo.dirstate.add(f)
1471 repo.dirstate.add(f)
@@ -1678,7 +1701,7 b' def update(repo, node, branchmerge, forc'
1678
1701
1679 if updatecheck == 'noconflict':
1702 if updatecheck == 'noconflict':
1680 for f, (m, args, msg) in actionbyfile.iteritems():
1703 for f, (m, args, msg) in actionbyfile.iteritems():
1681 if m not in ('g', 'k', 'e', 'r'):
1704 if m not in ('g', 'k', 'e', 'r', 'pr'):
1682 msg = _("conflicting changes")
1705 msg = _("conflicting changes")
1683 hint = _("commit or update --clean to discard changes")
1706 hint = _("commit or update --clean to discard changes")
1684 raise error.Abort(msg, hint=hint)
1707 raise error.Abort(msg, hint=hint)
@@ -1714,7 +1737,7 b' def update(repo, node, branchmerge, forc'
1714
1737
1715 # Convert to dictionary-of-lists format
1738 # Convert to dictionary-of-lists format
1716 actions = dict((m, [])
1739 actions = dict((m, [])
1717 for m in 'a am f g cd dc r dm dg m e k p'.split())
1740 for m in 'a am f g cd dc r dm dg m e k p pr'.split())
1718 for f, (m, args, msg) in actionbyfile.iteritems():
1741 for f, (m, args, msg) in actionbyfile.iteritems():
1719 if m not in actions:
1742 if m not in actions:
1720 actions[m] = []
1743 actions[m] = []
@@ -487,7 +487,7 b' def refreshwdir(repo, origstatus, origsp'
487
487
488 # Apply changes to disk
488 # Apply changes to disk
489 typeactions = dict((m, [])
489 typeactions = dict((m, [])
490 for m in 'a f g am cd dc r dm dg m e k p'.split())
490 for m in 'a f g am cd dc r dm dg m e k p pr'.split())
491 for f, (m, args, msg) in actions.iteritems():
491 for f, (m, args, msg) in actions.iteritems():
492 if m not in typeactions:
492 if m not in typeactions:
493 typeactions[m] = []
493 typeactions[m] = []
General Comments 0
You need to be logged in to leave comments. Login now