##// END OF EJS Templates
destutil: allow to disable the "on head check" in destmerge...
Pierre-Yves David -
r28140:276644ae default
parent child Browse files
Show More
@@ -216,7 +216,7 b" def _destmergebook(repo, action='merge',"
216 assert node is not None
216 assert node is not None
217 return node
217 return node
218
218
219 def _destmergebranch(repo, action='merge', sourceset=None):
219 def _destmergebranch(repo, action='merge', sourceset=None, onheadcheck=True):
220 """find merge destination based on branch heads"""
220 """find merge destination based on branch heads"""
221 node = None
221 node = None
222
222
@@ -235,7 +235,7 b" def _destmergebranch(repo, action='merge"
235 branch = ctx.branch()
235 branch = ctx.branch()
236
236
237 bheads = repo.branchheads(branch)
237 bheads = repo.branchheads(branch)
238 if not repo.revs('%ld and %ln', sourceset, bheads):
238 if onheadcheck and not repo.revs('%ld and %ln', sourceset, bheads):
239 # Case A: working copy if not on a head. (merge only)
239 # Case A: working copy if not on a head. (merge only)
240 #
240 #
241 # This is probably a user mistake We bailout pointing at 'hg update'
241 # This is probably a user mistake We bailout pointing at 'hg update'
@@ -275,7 +275,7 b" def _destmergebranch(repo, action='merge"
275 assert node is not None
275 assert node is not None
276 return node
276 return node
277
277
278 def destmerge(repo, action='merge', sourceset=None):
278 def destmerge(repo, action='merge', sourceset=None, onheadcheck=True):
279 """return the default destination for a merge
279 """return the default destination for a merge
280
280
281 (or raise exception about why it can't pick one)
281 (or raise exception about why it can't pick one)
@@ -285,7 +285,8 b" def destmerge(repo, action='merge', sour"
285 if repo._activebookmark:
285 if repo._activebookmark:
286 node = _destmergebook(repo, action=action, sourceset=sourceset)
286 node = _destmergebook(repo, action=action, sourceset=sourceset)
287 else:
287 else:
288 node = _destmergebranch(repo, action=action, sourceset=sourceset)
288 node = _destmergebranch(repo, action=action, sourceset=sourceset,
289 onheadcheck=onheadcheck)
289 return repo[node].rev()
290 return repo[node].rev()
290
291
291 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
292 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
General Comments 0
You need to be logged in to leave comments. Login now