mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
bundle: factor the 'getchangegroup' out
The call in the two branches is identical, so we can just issue it outside of the conditional.
This commit is contained in:
parent
ce3d8fe617
commit
e6d7dd827e
@ -1357,8 +1357,6 @@ def bundle(ui, repo, fname, dest=None, **opts):
|
||||
common = [repo.lookup(rev) for rev in base]
|
||||
heads = revs and map(repo.lookup, revs) or None
|
||||
outgoing = discovery.outgoing(repo, common, heads)
|
||||
cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
|
||||
version=cgversion)
|
||||
else:
|
||||
dest = ui.expandpath(dest or 'default-push', dest or 'default')
|
||||
dest, branches = hg.parseurl(dest, opts.get('branch'))
|
||||
@ -1369,8 +1367,7 @@ def bundle(ui, repo, fname, dest=None, **opts):
|
||||
onlyheads=heads,
|
||||
force=opts.get('force'),
|
||||
portable=True)
|
||||
cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
|
||||
version=cgversion)
|
||||
cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
|
||||
if not cg:
|
||||
scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user