# HG changeset patch # User Pierre-Yves David # Date 1396398112 25200 # Node ID f295b2ac357906c6c45c7abdc2f2f5b6159a804a # Parent 0b50788c160c05962bc3d147431fd1bc61dc2f28 pull: move return code in the pull operation object With bundle2 we'll have multiple code path susceptible to be responsible for adding changeset during the pull. We move it to the pull operation to simplify this the coming logic. The one doing the adding the changegroup will set the value. diff -r 0b50788c160c -r f295b2ac3579 mercurial/exchange.py --- a/mercurial/exchange.py Tue Feb 25 20:30:08 2014 +0100 +++ b/mercurial/exchange.py Tue Apr 01 17:21:52 2014 -0700 @@ -401,6 +401,8 @@ self.rheads = None # list of missing changeset to fetch remotly self.fetch = None + # result of changegroup pulling (used as returng code by pull) + self.cgresult = None @util.propertycache def pulledsubset(self): @@ -455,9 +457,9 @@ pullop.common, pullop.fetch, pullop.rheads = tmp if not pullop.fetch: pullop.repo.ui.status(_("no changes found\n")) - result = 0 + pullop.cgresult = 0 else: - result = _pullchangeset(pullop) + pullop.cgresult = _pullchangeset(pullop) _pullphase(pullop) _pullobsolete(pullop) @@ -466,7 +468,7 @@ pullop.releasetransaction() lock.release() - return result + return pullop.cgresult def _pullchangeset(pullop): """pull changeset from unbundle into the local repo"""