Comments
Patch
@@ -19,31 +19,33 @@ class pushoperation(object):
A new should be created at the begining of each push and discarded
afterward.
"""
- def __init__(self, repo, remote, force=False, revs=None):
+ def __init__(self, repo, remote, force=False, revs=None, newbranch=False):
# repo we push from
self.repo = repo
self.ui = repo.ui
# repo we push to
self.remote = remote
# force option provided
self.force = force
# revs to be pushed (None is "all")
self.revs = revs
+ # allow push of new branch
+ self.newbranch = newbranch
def push(repo, remote, force=False, revs=None, newbranch=False):
'''Push outgoing changesets (limited by revs) from a local
repository to remote. Return an integer:
- None means nothing to push
- 0 means HTTP error
- 1 means we pushed and remote head count is unchanged *or*
we have outgoing changesets but refused to push
- other values as described by addchangegroup()
'''
- pushop = pushoperation(repo, remote, force, revs)
+ pushop = pushoperation(repo, remote, force, revs, newbranch)
if pushop.remote.local():
missing = (set(pushop.repo.requirements)
- pushop.remote.local().supported)
if missing:
msg = _("required features are not"
@@ -132,11 +134,11 @@ def push(repo, remote, force=False, revs
raise util.Abort(_(mst)
% (ctx.troubles()[0],
ctx))
newbm = pushop.ui.configlist('bookmarks', 'pushing')
discovery.checkheads(unfi, pushop.remote, outgoing,
- remoteheads, newbranch,
+ remoteheads, pushop.newbranch,
bool(inc), newbm)
# TODO: get bundlecaps from remote
bundlecaps = None
# create a changegroup from local