Patchwork D3828: rebase: add **opts to _prepareabortorcontinue

login
register
mail settings
Submitter phabricator
Date June 22, 2018, 2:13 p.m.
Message ID <differential-rev-PHID-DREV-znwmeakec6ogknfgh3sq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32381/
State Superseded
Headers show

Comments

phabricator - June 22, 2018, 2:13 p.m.
khanchi97 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Added keyword arguments option so that we can pass some options
  to abort method like nobackup option.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3828

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: mercurial-devel
phabricator - June 22, 2018, 2:18 p.m.
pulkit added inline comments.

INLINE COMMENTS

> rebase.py:328
>  
> -    def _prepareabortorcontinue(self, isabort):
> +    def _prepareabortorcontinue(self, isabort, **opts):
>          try:

As mentioned on IRC also, we should prevent using keyword arguments because in Python 3, we need to convert the keys to unicodes and then maybe back to bytes too. Can't we just pass this as a dictionary or add a new argument?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3828

To: khanchi97, #hg-reviewers
Cc: pulkit, mercurial-devel
sushil khanchi - June 22, 2018, 5:13 p.m.
@pulkit I have added a new argument in _prepareabortorcontinue. Now I think
there is no need to split that patch, if I am not wrong. We can leave this
patch here.
Thanks :)

On Fri, Jun 22, 2018 at 7:48 PM, pulkit (Pulkit Goyal) <
phabricator@mercurial-scm.org> wrote:

> pulkit added inline comments.
>
> INLINE COMMENTS
>
> > rebase.py:328
> >
> > -    def _prepareabortorcontinue(self, isabort):
> > +    def _prepareabortorcontinue(self, isabort, **opts):
> >          try:
>
> As mentioned on IRC also, we should prevent using keyword arguments
> because in Python 3, we need to convert the keys to unicodes and then maybe
> back to bytes too. Can't we just pass this as a dictionary or add a new
> argument?
>
> REPOSITORY
>   rHG Mercurial
>
> REVISION DETAIL
>   https://phab.mercurial-scm.org/D3828
>
> To: khanchi97, #hg-reviewers
> Cc: pulkit, mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@ 
         skippedset.update(obsoleteextinctsuccessors)
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-    def _prepareabortorcontinue(self, isabort):
+    def _prepareabortorcontinue(self, isabort, **opts):
         try:
             self.restorestatus()
             self.collapsemsg = restorecollapsemsg(self.repo, isabort)