Show More
@@ -131,23 +131,30 b' def destupdate(repo, clean=False, check=' | |||||
131 |
|
131 | |||
132 | return rev, movemark, activemark |
|
132 | return rev, movemark, activemark | |
133 |
|
133 | |||
|
134 | def _destmergebook(repo): | |||
|
135 | """find merge destination in the active bookmark case""" | |||
|
136 | node = None | |||
|
137 | bmheads = repo.bookmarkheads(repo._activebookmark) | |||
|
138 | curhead = repo[repo._activebookmark].node() | |||
|
139 | if len(bmheads) == 2: | |||
|
140 | if curhead == bmheads[0]: | |||
|
141 | node = bmheads[1] | |||
|
142 | else: | |||
|
143 | node = bmheads[0] | |||
|
144 | elif len(bmheads) > 2: | |||
|
145 | raise error.Abort(_("multiple matching bookmarks to merge - " | |||
|
146 | "please merge with an explicit rev or bookmark"), | |||
|
147 | hint=_("run 'hg heads' to see all heads")) | |||
|
148 | elif len(bmheads) <= 1: | |||
|
149 | raise error.Abort(_("no matching bookmark to merge - " | |||
|
150 | "please merge with an explicit rev or bookmark"), | |||
|
151 | hint=_("run 'hg heads' to see all heads")) | |||
|
152 | assert node is not None | |||
|
153 | return node | |||
|
154 | ||||
134 | def destmerge(repo): |
|
155 | def destmerge(repo): | |
135 | if repo._activebookmark: |
|
156 | if repo._activebookmark: | |
136 | bmheads = repo.bookmarkheads(repo._activebookmark) |
|
157 | node = _destmergebook(repo) | |
137 | curhead = repo[repo._activebookmark].node() |
|
|||
138 | if len(bmheads) == 2: |
|
|||
139 | if curhead == bmheads[0]: |
|
|||
140 | node = bmheads[1] |
|
|||
141 | else: |
|
|||
142 | node = bmheads[0] |
|
|||
143 | elif len(bmheads) > 2: |
|
|||
144 | raise error.Abort(_("multiple matching bookmarks to merge - " |
|
|||
145 | "please merge with an explicit rev or bookmark"), |
|
|||
146 | hint=_("run 'hg heads' to see all heads")) |
|
|||
147 | elif len(bmheads) <= 1: |
|
|||
148 | raise error.Abort(_("no matching bookmark to merge - " |
|
|||
149 | "please merge with an explicit rev or bookmark"), |
|
|||
150 | hint=_("run 'hg heads' to see all heads")) |
|
|||
151 | else: |
|
158 | else: | |
152 | branch = repo[None].branch() |
|
159 | branch = repo[None].branch() | |
153 | bheads = repo.branchheads(branch) |
|
160 | bheads = repo.branchheads(branch) |
General Comments 0
You need to be logged in to leave comments.
Login now