# HG changeset patch # User Kostia Balytskyi <ikos...@fb.com> # Date 1478543425 28800 # Mon Nov 07 10:30:25 2016 -0800 # Node ID 914e385828e4597d1e1ae0a97d8cd24a32d8e029 # Parent 31ef2cba32928a93982ea6adea2d189030ce18bf shelve: move actual created commit shelving to a separate function
Currently, this code does not have any branching, it just bundles a commit and saves a patch file. Later, obsolescense-based shelve will be added, so this code will also create some obsmarkers and will be one of the few places where obsshelve will be different from traditional shelve. diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -330,6 +330,12 @@ def _nothingtoshelvemessaging(ui, repo, else: ui.status(_("nothing changed\n")) +def _shelvecreatedcommit(repo, node, name): + bases = list(mutableancestors(repo[node])) + shelvedfile(repo, name, 'hg').writebundle(bases, node) + cmdutil.export(repo, [node], + fp=shelvedfile(repo, name, 'patch').opener('wb'), + opts=mdiff.diffopts(git=True)) def _docreatecmd(ui, repo, pats, opts): wctx = repo[None] @@ -382,12 +388,7 @@ def _docreatecmd(ui, repo, pats, opts): _nothingtoshelvemessaging(ui, repo, pats, opts) return 1 - bases = list(mutableancestors(repo[node])) - shelvedfile(repo, name, 'hg').writebundle(bases, node) - cmdutil.export(repo, [node], - fp=shelvedfile(repo, name, 'patch').opener('wb'), - opts=mdiff.diffopts(git=True)) - + _shelvecreatedcommit(repo, node, name) if ui.formatted(): desc = util.ellipsis(desc, ui.termwidth()) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel