##// END OF EJS Templates
update: add tracking of interrupted updates (issue3113)...
Matt Mackall -
r19482:499fc471 stable
parent child Browse files
Show More
@@ -2110,7 +2110,9 b' summaryhooks = util.hooks()'
2110 # (state file, clearable, error, hint)
2110 # (state file, clearable, error, hint)
2111 unfinishedstates = [
2111 unfinishedstates = [
2112 ('graftstate', True, _('graft in progress'),
2112 ('graftstate', True, _('graft in progress'),
2113 _("use 'hg graft --continue' or 'hg update' to abort"))
2113 _("use 'hg graft --continue' or 'hg update' to abort")),
2114 ('updatestate', True, _('last update was interrupted'),
2115 _("use 'hg update' to get a consistent checkout"))
2114 ]
2116 ]
2115
2117
2116 def checkunfinished(repo):
2118 def checkunfinished(repo):
@@ -5482,7 +5482,9 b' def summary(ui, repo, **opts):'
5482 t = ', '.join(t)
5482 t = ', '.join(t)
5483 cleanworkdir = False
5483 cleanworkdir = False
5484
5484
5485 if len(parents) > 1:
5485 if repo.vfs.exists('updatestate'):
5486 t += _(' (interrupted update)')
5487 elif len(parents) > 1:
5486 t += _(' (merge)')
5488 t += _(' (merge)')
5487 elif branch != parents[0].branch():
5489 elif branch != parents[0].branch():
5488 t += _(' (new branch)')
5490 t += _(' (new branch)')
@@ -747,12 +747,17 b' def update(repo, node, branchmerge, forc'
747 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
747 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
748 if not partial:
748 if not partial:
749 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
749 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
750 # note that we're in the middle of an update
751 repo.vfs.write('updatestate', p2.hex())
750
752
751 stats = applyupdates(repo, actions, wc, p2, pa, overwrite)
753 stats = applyupdates(repo, actions, wc, p2, pa, overwrite)
752
754
753 if not partial:
755 if not partial:
754 repo.setparents(fp1, fp2)
756 repo.setparents(fp1, fp2)
755 recordupdates(repo, actions, branchmerge)
757 recordupdates(repo, actions, branchmerge)
758 # update completed, clear state
759 util.unlink(repo.join('updatestate'))
760
756 if not branchmerge:
761 if not branchmerge:
757 repo.dirstate.setbranch(p2.branch())
762 repo.dirstate.setbranch(p2.branch())
758 finally:
763 finally:
@@ -23,6 +23,37 b''
23
23
24 $ hg update 0
24 $ hg update 0
25 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
26
27 Test interrupted updates by exploiting our non-handling of directory collisions
28
29 $ mkdir b
30 $ hg up
31 abort: Is a directory: '$TESTTMP/t/b'
32 [255]
33 $ hg ci
34 abort: last update was interrupted
35 (use 'hg update' to get a consistent checkout)
36 [255]
37 $ hg sum
38 parent: 0:538afb845929
39 commit #0
40 branch: default
41 commit: (interrupted update)
42 update: 1 new changesets (update)
43 $ rmdir b
44 $ hg up
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ hg sum
47 parent: 1:b8bb4a988f25 tip
48 commit #1
49 branch: default
50 commit: (clean)
51 update: (current)
52
53 Prepare a basic merge
54
55 $ hg up 0
56 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
26 $ echo This is file c1 > c
57 $ echo This is file c1 > c
27 $ hg add c
58 $ hg add c
28 $ hg commit -m "commit #2"
59 $ hg commit -m "commit #2"
General Comments 0
You need to be logged in to leave comments. Login now