mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
selectivepull: fix passing heads
argument multiple times
Usually `heads` are passed using kwargs but sometimes they are passed using args (for example, during clone). In this case we set in kwargs and args and orig call fails. This patch fixes it. Also change the tests to cover this behaviour.
This commit is contained in:
parent
a4e7efbbbc
commit
0ea53d2942
@ -133,6 +133,11 @@ def expull(orig, repo, remote, *args, **kwargs):
|
||||
bookmarks[bookmark] = remotebookmarks[bookmark]
|
||||
else:
|
||||
heads = kwargs.get('heads') or []
|
||||
# heads may be passed as positional args
|
||||
if len(args) > 0:
|
||||
if args[0]:
|
||||
heads = args[0]
|
||||
args = args[1:]
|
||||
for bookmark in bookmarks:
|
||||
heads.append(remote.lookup(remotebookmarks[bookmark]))
|
||||
kwargs['bookmarks'] = bookmarks
|
||||
|
@ -97,7 +97,7 @@ Specify bookmark to pull
|
||||
|
||||
Create second remote
|
||||
$ cd ..
|
||||
$ hg clone -q remoterepo secondremoterepo
|
||||
$ hg clone -q ssh://user@dummy/remoterepo secondremoterepo
|
||||
$ cd secondremoterepo
|
||||
$ hg up -q 0238718db2b1
|
||||
$ hg book master
|
||||
|
Loading…
Reference in New Issue
Block a user