Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG1b03407e808d: merge: skip subrepo state, update hooks, and updating the dirstate in IMM
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/merge.py (9 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Closed | phillco | ||
Abandoned | phillco |
elif pas == [p1]: | elif pas == [p1]: | ||||
if not mergeancestor and wc.branch() == p2.branch(): | if not mergeancestor and wc.branch() == p2.branch(): | ||||
raise error.Abort(_("nothing to merge"), | raise error.Abort(_("nothing to merge"), | ||||
hint=_("use 'hg update' " | hint=_("use 'hg update' " | ||||
"or check 'hg heads'")) | "or check 'hg heads'")) | ||||
if not force and (wc.files() or wc.deleted()): | if not force and (wc.files() or wc.deleted()): | ||||
raise error.Abort(_("uncommitted changes"), | raise error.Abort(_("uncommitted changes"), | ||||
hint=_("use 'hg status' to list changes")) | hint=_("use 'hg status' to list changes")) | ||||
if not wc.isinmemory(): | |||||
for s in sorted(wc.substate): | for s in sorted(wc.substate): | ||||
wc.sub(s).bailifchanged() | wc.sub(s).bailifchanged() | ||||
elif not overwrite: | elif not overwrite: | ||||
if p1 == p2: # no-op update | if p1 == p2: # no-op update | ||||
# call the hooks and exit early | # call the hooks and exit early | ||||
repo.hook('preupdate', throw=True, parent1=xp2, parent2='') | repo.hook('preupdate', throw=True, parent1=xp2, parent2='') | ||||
repo.hook('update', parent1=xp2, parent2='', error=0) | repo.hook('update', parent1=xp2, parent2='', error=0) | ||||
return 0, 0, 0, 0 | return 0, 0, 0, 0 | ||||
repo.ui.warn(_("note: possible conflict - %s was deleted " | repo.ui.warn(_("note: possible conflict - %s was deleted " | ||||
"and renamed to:\n") % f) | "and renamed to:\n") % f) | ||||
for nf in fl: | for nf in fl: | ||||
repo.ui.warn(" %s\n" % nf) | repo.ui.warn(" %s\n" % nf) | ||||
### apply phase | ### apply phase | ||||
if not branchmerge: # just jump to the new rev | if not branchmerge: # just jump to the new rev | ||||
fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' | fp1, fp2, xp1, xp2 = fp2, nullid, xp2, '' | ||||
if not partial: | if not partial and not wc.isinmemory(): | ||||
repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) | repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2) | ||||
# note that we're in the middle of an update | # note that we're in the middle of an update | ||||
repo.vfs.write('updatestate', p2.hex()) | repo.vfs.write('updatestate', p2.hex()) | ||||
# Advertise fsmonitor when its presence could be useful. | # Advertise fsmonitor when its presence could be useful. | ||||
# | # | ||||
# We only advertise when performing an update from an empty working | # We only advertise when performing an update from an empty working | ||||
# directory. This typically only occurs during initial clone. | # directory. This typically only occurs during initial clone. | ||||
and pycompat.sysplatform.startswith(('linux', 'darwin'))): | and pycompat.sysplatform.startswith(('linux', 'darwin'))): | ||||
repo.ui.warn( | repo.ui.warn( | ||||
_('(warning: large working directory being used without ' | _('(warning: large working directory being used without ' | ||||
'fsmonitor enabled; enable fsmonitor to improve performance; ' | 'fsmonitor enabled; enable fsmonitor to improve performance; ' | ||||
'see "hg help -e fsmonitor")\n')) | 'see "hg help -e fsmonitor")\n')) | ||||
stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels) | stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels) | ||||
if not partial: | if not partial and not wc.isinmemory(): | ||||
with repo.dirstate.parentchange(): | with repo.dirstate.parentchange(): | ||||
repo.setparents(fp1, fp2) | repo.setparents(fp1, fp2) | ||||
recordupdates(repo, actions, branchmerge) | recordupdates(repo, actions, branchmerge) | ||||
# update completed, clear state | # update completed, clear state | ||||
util.unlink(repo.vfs.join('updatestate')) | util.unlink(repo.vfs.join('updatestate')) | ||||
if not branchmerge: | if not branchmerge: | ||||
repo.dirstate.setbranch(p2.branch()) | repo.dirstate.setbranch(p2.branch()) |