comparison hgsubversion/svnrepo.py @ 1246:2179747e7fea

push: wrap exchange.push when localrepository.push isn't available Mercurial rev 4d52e6eb98ea removed localrepository.push. We don't do it the other way round (wrap push if exchange.push is available) because that's been available with a different signature since Mercurial 3.0.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 13 Oct 2014 23:55:27 -0700
parents c55b94dc3a48
children 3a4d74823187
comparison
equal deleted inserted replaced
1245:260212f056b7 1246:2179747e7fea
15 """ 15 """
16 16
17 import errno 17 import errno
18 18
19 from mercurial import error 19 from mercurial import error
20 from mercurial import localrepo
20 from mercurial import util as hgutil 21 from mercurial import util as hgutil
21 22
22 try: 23 try:
23 from mercurial.peer import peerrepository 24 from mercurial.peer import peerrepository
24 from mercurial import httppeer 25 from mercurial import httppeer
93 if phases is not None and getattr(self, 'pushkey', False): 94 if phases is not None and getattr(self, 'pushkey', False):
94 # set phase to be public 95 # set phase to be public
95 self.pushkey('phases', self[hash].hex(), str(phases.draft), str(phases.public)) 96 self.pushkey('phases', self[hash].hex(), str(phases.draft), str(phases.public))
96 return hash 97 return hash
97 98
98 # TODO use newbranch to allow branch creation in Subversion? 99 if hgutil.safehasattr(localrepo.localrepository, 'push'):
99 @remotesvn 100 # Mercurial < 3.2
100 def push(self, remote, force=False, revs=None, newbranch=None): 101 # TODO use newbranch to allow branch creation in Subversion?
101 return wrappers.push(self, remote, force, revs) 102 @remotesvn
103 def push(self, remote, force=False, revs=None, newbranch=None):
104 return wrappers.push(self, remote, force, revs)
102 105
103 @remotesvn 106 @remotesvn
104 def pull(self, remote, heads=[], force=False): 107 def pull(self, remote, heads=[], force=False):
105 return wrappers.pull(self, remote, heads, force) 108 return wrappers.pull(self, remote, heads, force)
106 109