@@ -22,10 +22,11 @@ class pushoperation(object):
"""
def __init__(self, repo):
# repo we push from
self.repo = repo
+ self.ui = repo.ui
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
@@ -63,12 +64,12 @@ def push(repo, remote, force=False, revs
# Informs the user that phases should have been moved when
# applicable.
actualmoves = [n for n in nodes if phase < pushop.repo[n].phase()]
phasestr = phases.phasenames[phase]
if actualmoves:
- pushop.repo.ui.status(_('cannot lock source repo, skipping '
- 'local %s phase update\n') % phasestr)
+ pushop.ui.status(_('cannot lock source repo, skipping '
+ 'local %s phase update\n') % phasestr)
# get local lock as we might write phase data
locallock = None
try:
locallock = pushop.repo.lock()
except IOError, err:
@@ -76,11 +77,11 @@ def push(repo, remote, force=False, revs
raise
# source repo cannot be locked.
# We do not abort the push, but just disable the local phase
# synchronisation.
msg = 'cannot lock source repository: %s\n' % err
- pushop.repo.ui.debug(msg)
+ pushop.ui.debug(msg)
try:
pushop.repo.checkpush(force, revs)
lock = None
unbundle = remote.capable('unbundle')
if not unbundle:
@@ -122,11 +123,11 @@ def push(repo, remote, force=False, revs
raise util.Abort(mso % ctx)
elif ctx.troubled():
raise util.Abort(_(mst)
% (ctx.troubles()[0],
ctx))
- newbm = pushop.repo.ui.configlist('bookmarks', 'pushing')
+ newbm = pushop.ui.configlist('bookmarks', 'pushing')
discovery.checkheads(unfi, remote, outgoing,
remoteheads, newbranch,
bool(inc), newbm)
# TODO: get bundlecaps from remote
@@ -190,11 +191,11 @@ def push(repo, remote, force=False, revs
outgoing.commonheads,
outgoing.missing)
cheads.extend(c.node() for c in revset)
# even when we don't push, exchanging phase data is useful
remotephases = remote.listkeys('phases')
- if (pushop.repo.ui.configbool('ui', '_usedassubrepo', False)
+ if (pushop.ui.configbool('ui', '_usedassubrepo', False)
and remotephases # server supports phases
and ret is None # nothing was pushed
and remotephases.get('publishing', False)):
# When:
# - this is a subrepo push
@@ -230,18 +231,18 @@ def push(repo, remote, force=False, revs
r = remote.pushkey('phases',
newremotehead.hex(),
str(phases.draft),
str(phases.public))
if not r:
- pushop.repo.ui.warn(_('updating %s to public failed!\n')
- % newremotehead)
- pushop.repo.ui.debug('try to push obsolete markers to remote\n')
+ pushop.ui.warn(_('updating %s to public failed!\n')
+ % newremotehead)
+ pushop.ui.debug('try to push obsolete markers to remote\n')
obsolete.syncpush(pushop.repo, remote)
finally:
if lock is not None:
lock.release()
finally:
if locallock is not None:
locallock.release()
- bookmarks.updateremote(pushop.repo.ui, unfi, remote, revs)
+ bookmarks.updateremote(pushop.ui, unfi, remote, revs)
return ret