# HG changeset patch # User Pierre-Yves David # Date 1391142875 28800 # Node ID 0031ef5df586f6bb69da663a9416666c5bc8e83a # Parent abd8e56a1038b938fe6da1b3408b6ca245877ccd push: move `remoteheads` into the push object The heads of the remote repository are used to detect race when pushing changeset. We now store this information in `pushoperation` object to allow extraction of the changeset pushing part. diff -r abd8e56a1038 -r 0031ef5df586 mercurial/exchange.py --- a/mercurial/exchange.py Tue Feb 04 15:07:03 2014 -0800 +++ b/mercurial/exchange.py Thu Jan 30 20:34:35 2014 -0800 @@ -44,6 +44,8 @@ self.ret = None # discover.outgoing object (contains common and outgoin data) self.outgoing = None + # all remote heads before the push + self.remoteheads = None def push(repo, remote, force=False, revs=None, newbranch=False): '''Push outgoing changesets (limited by revs) from a local @@ -104,6 +106,7 @@ outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs, commoninc=commoninc, force=pushop.force) pushop.outgoing = outgoing + pushop.remoteheads = remoteheads if not outgoing.missing: @@ -163,6 +166,8 @@ # commit/push race), server aborts. if pushop.force: remoteheads = ['force'] + else: + remoteheads = pushop.remoteheads # ssh: return remote's addchangegroup() # http: return remote's addchangegroup() or 0 for error pushop.ret = pushop.remote.unbundle(cg, remoteheads,