##// END OF EJS Templates
destupdate: extract logic based on obsolescence marker in its own function...
Pierre-Yves David -
r26723:52d08a93 default
parent child Browse files
Show More
@@ -40,20 +40,12 b' def _destupdatevalidate(repo, rev, clean'
40 hint = _("merge or update --check to force update")
40 hint = _("merge or update --check to force update")
41 raise error.UpdateAbort(msg, hint=hint)
41 raise error.UpdateAbort(msg, hint=hint)
42
42
43 def destupdate(repo, clean=False, check=False):
43 def _destupdateobs(repo, clean, check):
44 """destination for bare update operation
44 """decide of an update destination from obsolescence markers"""
45
46 return (rev, movemark, activemark)
47
48 - rev: the revision to update to,
49 - movemark: node to move the active bookmark from
50 (cf bookmark.calculate update),
51 - activemark: a bookmark to activate at the end of the update.
52 """
53 node = None
45 node = None
54 wc = repo[None]
46 wc = repo[None]
55 p1 = wc.p1()
47 p1 = wc.p1()
56 movemark = activemark = None
48 movemark = None
57
49
58 if p1.obsolete() and not p1.children():
50 if p1.obsolete() and not p1.children():
59 # allow updating to successors
51 # allow updating to successors
@@ -82,6 +74,23 b' def destupdate(repo, clean=False, check='
82 node = repo.revs('max(%ln)', successors).first()
74 node = repo.revs('max(%ln)', successors).first()
83 if bookmarks.isactivewdirparent(repo):
75 if bookmarks.isactivewdirparent(repo):
84 movemark = repo['.'].node()
76 movemark = repo['.'].node()
77 return node, movemark, None
78
79 def destupdate(repo, clean=False, check=False):
80 """destination for bare update operation
81
82 return (rev, movemark, activemark)
83
84 - rev: the revision to update to,
85 - movemark: node to move the active bookmark from
86 (cf bookmark.calculate update),
87 - activemark: a bookmark to activate at the end of the update.
88 """
89 node = None
90 wc = repo[None]
91 movemark = activemark = None
92
93 node, movemark, activemark = _destupdateobs(repo, clean, check)
85
94
86 if node is None:
95 if node is None:
87 # we also move the active bookmark, if any
96 # we also move the active bookmark, if any
General Comments 0
You need to be logged in to leave comments. Login now