##// END OF EJS Templates
rebase: restrict rebase destination to the pulled set (issue5214)...
rebase: restrict rebase destination to the pulled set (issue5214) Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull` followed by `hg rebase` if anything was pulled. Now that rebase pick his default destination the same way than merge, than `hg rebase` step would abort in the case the repo already had multiple anonymous heads (because of the ambiguity). (changed in fac3a24be50e) The intend of the user with `hg pull --rebase` is clearly to rebase on pulled content. This used to be (mostly) enforced by the former default destination for rebase, "tipmost changeset of the branch" as the tipmost would likely a changeset that just got pulled. But this intended was no longer enforced with the new defaul destination (unified with merge). This changeset makes use of the '_destspace' mechanism introduced in the previous changeset to enforce this. This partially fixes issue5214 as no change at all have been made to the new handling of the case with bookmark (unified with merge).

File last commit:

r28562:2b585677 default
r29044:261c2537 stable
Show More
python-hook-examples.py
26 lines | 630 B | text/x-python | PythonLexer
/ contrib / python-hook-examples.py
Alexander Solovyov
diffstat hook example
r7917 '''
Benoit Boissinot
Change wording in example hook
r7918 Examples of useful python hooks for Mercurial.
Alexander Solovyov
diffstat hook example
r7917 '''
Pulkit Goyal
contrib: python-hook-examples use absolute_import
r28562 from __future__ import absolute_import
from mercurial import (
patch,
util,
)
Alexander Solovyov
diffstat hook example
r7917
def diffstat(ui, repo, **kwargs):
Benoit Boissinot
Change wording in example hook
r7918 '''Example usage:
Alexander Solovyov
diffstat hook example
r7917
[hooks]
commit.diffstat = python:/path/to/this/file.py:diffstat
changegroup.diffstat = python:/path/to/this/file.py:diffstat
'''
if kwargs.get('parent2'):
return
node = kwargs['node']
Matt Mackall
misc: replace .parents()[0] with p1()
r13878 first = repo[node].p1().node()
Alexander Solovyov
diffstat hook example
r7917 if 'url' in kwargs:
last = repo['tip'].node()
else:
last = node
diff = patch.diff(repo, first, last)
ui.write(patch.diffstat(util.iterlines(diff)))