Patchwork D5484: pull: use opts.get('bookmark') instead of opts['bookmark']

login
register
mail settings
Submitter phabricator
Date Dec. 27, 2018, 12:54 p.m.
Message ID <845ca6feec20ff5ab115b9768bf7a80f@localhost.localdomain>
Download mbox | patch
Permalink /patch/37364/
State Not Applicable
Headers show

Comments

phabricator - Dec. 27, 2018, 12:54 p.m.
pulkit updated this revision to Diff 12986.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5484?vs=12981&id=12986

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: yuja, mercurial-devel
Yuya Nishihara - Dec. 27, 2018, 1:16 p.m.
> @@ -4438,7 +4438,7 @@
>              remotebookmarks = fremotebookmarks.result()
>              remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks)
>              pullopargs['remotebookmarks'] = remotebookmarks
> -            for b in opts['bookmark']:
> +            for b in opts.get('bookmark'):

Still wrong. It's `for b in None`.
phabricator - Dec. 27, 2018, 1:17 p.m.
yuja added a comment.


  > @@ -4438,7 +4438,7 @@
  > 
  >   remotebookmarks = fremotebookmarks.result()
  >   remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks)
  >   pullopargs['remotebookmarks'] = remotebookmarks
  > 
  > - for b in opts['bookmark']: +            for b in opts.get('bookmark'):
  
  Still wrong. It's `for b in None`.

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4417,7 +4417,7 @@ 
         pullopargs = {}
 
         nodes = None
-        if opts['bookmark'] or revs:
+        if opts.get('bookmark') or revs:
             # The list of bookmark used here is the same used to actually update
             # the bookmark names, to avoid the race from issue 4689 and we do
             # all lookup and bookmark queries in one go so they see the same
@@ -4438,7 +4438,7 @@ 
             remotebookmarks = fremotebookmarks.result()
             remotebookmarks = bookmarks.unhexlifybookmarks(remotebookmarks)
             pullopargs['remotebookmarks'] = remotebookmarks
-            for b in opts['bookmark']:
+            for b in opts.get('bookmark'):
                 b = repo._bookmarks.expandname(b)
                 if b not in remotebookmarks:
                     raise error.Abort(_('remote bookmark %s not found!') % b)