##// END OF EJS Templates
merge: handle subrepo merges and .hgsubstate specially...
Bryan O'Sullivan -
r18632:3e200791 default
parent child Browse files
Show More
@@ -342,10 +342,9 b' def manifestmerge(repo, wctx, p2, pa, br'
342 def actionkey(a):
342 def actionkey(a):
343 return a[1] == "r" and -1 or 0, a
343 return a[1] == "r" and -1 or 0, a
344
344
345 def getremove(repo, wctx, mctx, overwrite, args):
345 def getremove(repo, mctx, overwrite, args):
346 """apply usually-non-interactive updates to the working directory
346 """apply usually-non-interactive updates to the working directory
347
347
348 wctx is the working copy context
349 mctx is the context to be merged into the working copy
348 mctx is the context to be merged into the working copy
350
349
351 yields tuples for progress updates
350 yields tuples for progress updates
@@ -355,8 +354,6 b' def getremove(repo, wctx, mctx, overwrit'
355 f = arg[0]
354 f = arg[0]
356 if arg[1] == 'r':
355 if arg[1] == 'r':
357 repo.ui.note(_("removing %s\n") % f)
356 repo.ui.note(_("removing %s\n") % f)
358 if f == '.hgsubstate': # subrepo states need updating
359 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
360 audit(f)
357 audit(f)
361 try:
358 try:
362 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
359 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
@@ -366,8 +363,6 b' def getremove(repo, wctx, mctx, overwrit'
366 else:
363 else:
367 repo.ui.note(_("getting %s\n") % f)
364 repo.ui.note(_("getting %s\n") % f)
368 repo.wwrite(f, mctx.filectx(f).data(), arg[2][0])
365 repo.wwrite(f, mctx.filectx(f).data(), arg[2][0])
369 if f == '.hgsubstate': # subrepo states need updating
370 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
371 yield i, f
366 yield i, f
372
367
373 def applyupdates(repo, actions, wctx, mctx, actx, overwrite):
368 def applyupdates(repo, actions, wctx, mctx, actx, overwrite):
@@ -426,10 +421,17 b' def applyupdates(repo, actions, wctx, mc'
426 removed = len([a for a in workeractions if a[1] == 'r'])
421 removed = len([a for a in workeractions if a[1] == 'r'])
427 actions = [a for a in actions if a[1] not in 'gr']
422 actions = [a for a in actions if a[1] not in 'gr']
428
423
429 for i, item in getremove(repo, wctx, mctx, overwrite, workeractions):
424 hgsub = [a[1] for a in workeractions if a[0] == '.hgsubstate']
425 if hgsub and hgsub[0] == 'r':
426 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
427
428 for i, item in getremove(repo, mctx, overwrite, workeractions):
430 repo.ui.progress(_('updating'), i + 1, item=item, total=numupdates,
429 repo.ui.progress(_('updating'), i + 1, item=item, total=numupdates,
431 unit=_('files'))
430 unit=_('files'))
432
431
432 if hgsub and hgsub[0] == 'g':
433 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
434
433 z = len(workeractions)
435 z = len(workeractions)
434
436
435 for i, a in enumerate(actions):
437 for i, a in enumerate(actions):
General Comments 0
You need to be logged in to leave comments. Login now