mercurial/merge.py
changeset 35283 46510597d266
parent 35172 a92b9f8e11ba
child 35284 1b03407e808d
equal deleted inserted replaced
35282:46d7f0713a87 35283:46510597d266
  1331         # cwd was removed in the course of removing files; print a helpful
  1331         # cwd was removed in the course of removing files; print a helpful
  1332         # warning.
  1332         # warning.
  1333         repo.ui.warn(_("current directory was removed\n"
  1333         repo.ui.warn(_("current directory was removed\n"
  1334                        "(consider changing to repo root: %s)\n") % repo.root)
  1334                        "(consider changing to repo root: %s)\n") % repo.root)
  1335 
  1335 
  1336     # It's necessary to flush here in case we're inside a worker fork and will
       
  1337     # quit after this function.
       
  1338     wctx.flushall()
       
  1339 
       
  1340 def batchget(repo, mctx, wctx, actions):
  1336 def batchget(repo, mctx, wctx, actions):
  1341     """apply gets to the working directory
  1337     """apply gets to the working directory
  1342 
  1338 
  1343     mctx is the context to get from
  1339     mctx is the context to get from
  1344 
  1340 
  1374                 i = 0
  1370                 i = 0
  1375             i += 1
  1371             i += 1
  1376     if i > 0:
  1372     if i > 0:
  1377         yield i, f
  1373         yield i, f
  1378 
  1374 
  1379     # It's necessary to flush here in case we're inside a worker fork and will
       
  1380     # quit after this function.
       
  1381     wctx.flushall()
       
  1382 
  1375 
  1383 def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None):
  1376 def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None):
  1384     """apply the merge action list to the working directory
  1377     """apply the merge action list to the working directory
  1385 
  1378 
  1386     wctx is the working copy context
  1379     wctx is the working copy context
  1476             wctx[f].audit()
  1469             wctx[f].audit()
  1477             wctx[f].write(wctx.filectx(f0).data(), wctx.filectx(f0).flags())
  1470             wctx[f].write(wctx.filectx(f0).data(), wctx.filectx(f0).flags())
  1478             wctx[f0].remove()
  1471             wctx[f0].remove()
  1479         z += 1
  1472         z += 1
  1480         progress(_updating, z, item=f, total=numupdates, unit=_files)
  1473         progress(_updating, z, item=f, total=numupdates, unit=_files)
  1481 
       
  1482     # We should flush before forking into worker processes, since those workers
       
  1483     # flush when they complete, and we don't want to duplicate work.
       
  1484     wctx.flushall()
       
  1485 
  1474 
  1486     # get in parallel
  1475     # get in parallel
  1487     prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx),
  1476     prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx),
  1488                          actions['g'])
  1477                          actions['g'])
  1489     for i, item in prog:
  1478     for i, item in prog:
  2002                 _('(warning: large working directory being used without '
  1991                 _('(warning: large working directory being used without '
  2003                   'fsmonitor enabled; enable fsmonitor to improve performance; '
  1992                   'fsmonitor enabled; enable fsmonitor to improve performance; '
  2004                   'see "hg help -e fsmonitor")\n'))
  1993                   'see "hg help -e fsmonitor")\n'))
  2005 
  1994 
  2006         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
  1995         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
  2007         wc.flushall()
       
  2008 
  1996 
  2009         if not partial:
  1997         if not partial:
  2010             with repo.dirstate.parentchange():
  1998             with repo.dirstate.parentchange():
  2011                 repo.setparents(fp1, fp2)
  1999                 repo.setparents(fp1, fp2)
  2012                 recordupdates(repo, actions, branchmerge)
  2000                 recordupdates(repo, actions, branchmerge)