add --rebase to npull

Issue #35 new
Richard PALO
created an issue

It would be great to see '--rebase' added to npull if the rebase extension is enabled.

    --rebase                rebase working directory to branch head
 -t --tool VALUE            specify merge tool for rebase

The rebase extension wraps these onto pull in uisetup() so it doesn't seem to show up automatically. Perhaps hgnested could check to see if rebase is enabled and do the same.

Comments (4)

  1. Richard PALO reporter

    for proof of concept, here is a simple case for pull considering rebase:

    diff -r bd39764e6a83 hgnested/__init__.py
    --- a/hgnested/__init__.py      Wed Aug 10 10:02:26 2016 +0200
    +++ b/hgnested/__init__.py      Sun Mar 11 09:21:43 2018 +0100
    @@ -335,3 +335,13 @@
                 check=check)
         _nested_apply(ui, repo, commands.update, True, node=node, rev=rev,
                 clean=clean, date=date, check=check)
    +
    +def extsetup(ui):
    +    try:
    +        rebasemod = extensions.find('rebase')
    +        cmdtable['npull'] = (cmdtable['npull'][0],
    +            cmdutil.findcmd('pull', commands.table)[1][1],
    +            cmdtable['npull'][2])
    +    except KeyError:
    +        # rebase extension not found
    +        return
    

    update: Unfortunately, I notice that even though --rebase is added in the test, using npull -uv --rebase does not give the same results as if pull -uv --rebase is done directly in the nested repository.

    I'm curious whether this might be the the fault of the rebase extension using wrappers which might not be in effect for the nested repositories... (re https://www.mercurial-scm.org/wiki/WritingExtensions#Wrapping_methods_on_the_ui_and_repo_classes)

  2. Richard PALO reporter

    FYI

    -------- Message transféré --------
    Sujet : [Bug 5813] pull --rebase via hgnested's npull doesn't rebase correctly
    Date : Fri, 01 Jun 2018 06:16:26 +0000
    De : mercurial-bugs@mercurial-scm.org
    Pour : richard@NetBSD.org
    
    https://bz.mercurial-scm.org/show_bug.cgi?id=5813
    
    Augie Fackler <durin42@gmail.com> changed:
    
               What    |Removed                     |Added
    ----------------------------------------------------------------------------
                 Status|UNCONFIRMED                 |NEED_EXAMPLE
         Ever confirmed|0                           |1
                     CC|                            |durin42@gmail.com
    
    --- Comment #5 from Augie Fackler <durin42@gmail.com> ---
    OOC, why hgnested (which I've never heard of) rather than hg's built in subrepo
    support?
    
    If you can use subrepos, we can probably help you, otherwise you're likely on
    your own...
    
    (Setting to "need example" because that's the closest I've got to a "chatting"
    status)
    
  3. Log in to comment