# HG changeset patch # User Pierre-Yves David # Date 1392159098 28800 # Node ID 76e66654f74ebfde66ba87d007ecc61b1549e193 # Parent f715cc0b5107c3cecf1e9600ab78263c9985c618 pull: move `fetch` subset into the object Tree discovey use a `fetch` variable to know what is being pulled. We move this information in the `pulloperation` object. This make it possible to extract the changeset pulling logic into its own function. diff -r f715cc0b5107 -r 76e66654f74e mercurial/exchange.py --- a/mercurial/exchange.py Fri Jan 31 01:34:00 2014 -0800 +++ b/mercurial/exchange.py Tue Feb 11 14:51:38 2014 -0800 @@ -399,6 +399,8 @@ self.common = None # set of pulled head self.rheads = None + # list of missing changeset to fetch remotly + self.fetch = None @util.propertycache def pulledsubset(self): @@ -445,8 +447,8 @@ pullop.remote, heads=pullop.heads, force=force) - pullop.common, fetch, pullop.rheads = tmp - if not fetch: + pullop.common, pullop.fetch, pullop.rheads = tmp + if not pullop.fetch: pullop.repo.ui.status(_("no changes found\n")) result = 0 else: @@ -468,13 +470,14 @@ heads=(pullop.heads or pullop.rheads)) elif pullop.heads is None: - cg = pullop.remote.changegroup(fetch, 'pull') + cg = pullop.remote.changegroup(pullop.fetch, 'pull') elif not pullop.remote.capable('changegroupsubset'): raise util.Abort(_("partial pull cannot be done because " "other repository doesn't support " "changegroupsubset.")) else: - cg = pullop.remote.changegroupsubset(fetch, pullop.heads, + cg = pullop.remote.changegroupsubset(pullop.fetch, + pullop.heads, 'pull') result = pullop.repo.addchangegroup(cg, 'pull', pullop.remote.url())