Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 13323:d8d478f9ee0f
merge with stable
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 31 Jan 2011 13:38:00 +0100 |
parents | 6bf39d88c857 c19b9282d3a7 |
children | 14f3795a5ed7 |
comparison
equal
deleted
inserted
replaced
13315:0d1dca7d2a04 | 13323:d8d478f9ee0f |
---|---|
247 return action | 247 return action |
248 | 248 |
249 def actionkey(a): | 249 def actionkey(a): |
250 return a[1] == 'r' and -1 or 0, a | 250 return a[1] == 'r' and -1 or 0, a |
251 | 251 |
252 def applyupdates(repo, action, wctx, mctx, actx): | 252 def applyupdates(repo, action, wctx, mctx, actx, overwrite): |
253 """apply the merge action list to the working directory | 253 """apply the merge action list to the working directory |
254 | 254 |
255 wctx is the working copy context | 255 wctx is the working copy context |
256 mctx is the context to be merged into the working copy | 256 mctx is the context to be merged into the working copy |
257 actx is the context of the common ancestor | 257 actx is the context of the common ancestor |
308 continue | 308 continue |
309 if m == "r": # remove | 309 if m == "r": # remove |
310 repo.ui.note(_("removing %s\n") % f) | 310 repo.ui.note(_("removing %s\n") % f) |
311 audit_path(f) | 311 audit_path(f) |
312 if f == '.hgsubstate': # subrepo states need updating | 312 if f == '.hgsubstate': # subrepo states need updating |
313 subrepo.submerge(repo, wctx, mctx, wctx) | 313 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) |
314 try: | 314 try: |
315 util.unlinkpath(repo.wjoin(f)) | 315 util.unlinkpath(repo.wjoin(f)) |
316 except OSError, inst: | 316 except OSError, inst: |
317 if inst.errno != errno.ENOENT: | 317 if inst.errno != errno.ENOENT: |
318 repo.ui.warn(_("update failed to remove %s: %s!\n") % | 318 repo.ui.warn(_("update failed to remove %s: %s!\n") % |
319 (f, inst.strerror)) | 319 (f, inst.strerror)) |
320 removed += 1 | 320 removed += 1 |
321 elif m == "m": # merge | 321 elif m == "m": # merge |
322 if f == '.hgsubstate': # subrepo states need updating | 322 if f == '.hgsubstate': # subrepo states need updating |
323 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx)) | 323 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite) |
324 continue | 324 continue |
325 f2, fd, flags, move = a[2:] | 325 f2, fd, flags, move = a[2:] |
326 r = ms.resolve(fd, wctx, mctx) | 326 r = ms.resolve(fd, wctx, mctx) |
327 if r is not None and r > 0: | 327 if r is not None and r > 0: |
328 unresolved += 1 | 328 unresolved += 1 |
341 t = mctx.filectx(f).data() | 341 t = mctx.filectx(f).data() |
342 repo.wwrite(f, t, flags) | 342 repo.wwrite(f, t, flags) |
343 t = None | 343 t = None |
344 updated += 1 | 344 updated += 1 |
345 if f == '.hgsubstate': # subrepo states need updating | 345 if f == '.hgsubstate': # subrepo states need updating |
346 subrepo.submerge(repo, wctx, mctx, wctx) | 346 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) |
347 elif m == "d": # directory rename | 347 elif m == "d": # directory rename |
348 f2, fd, flags = a[2:] | 348 f2, fd, flags = a[2:] |
349 if f: | 349 if f: |
350 repo.ui.note(_("moving %s to %s\n") % (f, fd)) | 350 repo.ui.note(_("moving %s to %s\n") % (f, fd)) |
351 t = wctx.filectx(f).data() | 351 t = wctx.filectx(f).data() |
532 if not branchmerge or fastforward: # just jump to the new rev | 532 if not branchmerge or fastforward: # just jump to the new rev |
533 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' | 533 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' |
534 if not partial: | 534 if not partial: |
535 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) | 535 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) |
536 | 536 |
537 stats = applyupdates(repo, action, wc, p2, pa) | 537 stats = applyupdates(repo, action, wc, p2, pa, overwrite) |
538 | 538 |
539 if not partial: | 539 if not partial: |
540 repo.dirstate.setparents(fp1, fp2) | 540 repo.dirstate.setparents(fp1, fp2) |
541 recordupdates(repo, action, branchmerge and not fastforward) | 541 recordupdates(repo, action, branchmerge and not fastforward) |
542 if not branchmerge and not fastforward: | 542 if not branchmerge and not fastforward: |