1303 cg = remote.changegroupsubset(fetch, heads, 'pull') |
1303 cg = remote.changegroupsubset(fetch, heads, 'pull') |
1304 return self.addchangegroup(cg, 'pull', remote.url(), lock=lock) |
1304 return self.addchangegroup(cg, 'pull', remote.url(), lock=lock) |
1305 finally: |
1305 finally: |
1306 lock.release() |
1306 lock.release() |
1307 |
1307 |
|
1308 def checkpush(self, force, revs): |
|
1309 """Extensions can override this function if additional checks have |
|
1310 to be performed before pushing, or call it if they override push |
|
1311 command. |
|
1312 """ |
|
1313 pass |
|
1314 |
1308 def push(self, remote, force=False, revs=None, newbranch=False): |
1315 def push(self, remote, force=False, revs=None, newbranch=False): |
1309 '''Push outgoing changesets (limited by revs) from the current |
1316 '''Push outgoing changesets (limited by revs) from the current |
1310 repository to remote. Return an integer: |
1317 repository to remote. Return an integer: |
1311 - 0 means HTTP error *or* nothing to push |
1318 - 0 means HTTP error *or* nothing to push |
1312 - 1 means we pushed and remote head count is unchanged *or* |
1319 - 1 means we pushed and remote head count is unchanged *or* |
1319 # repo (local filesystem, old ssh servers). |
1326 # repo (local filesystem, old ssh servers). |
1320 # |
1327 # |
1321 # unbundle assumes local user cannot lock remote repo (new ssh |
1328 # unbundle assumes local user cannot lock remote repo (new ssh |
1322 # servers, http servers). |
1329 # servers, http servers). |
1323 |
1330 |
|
1331 self.checkpush(force, revs) |
1324 lock = None |
1332 lock = None |
1325 unbundle = remote.capable('unbundle') |
1333 unbundle = remote.capable('unbundle') |
1326 if not unbundle: |
1334 if not unbundle: |
1327 lock = remote.lock() |
1335 lock = remote.lock() |
1328 try: |
1336 try: |