[PATCH 3 of 5 REVIEW] phases: marked content of a changegroup as published

Matt Mackall mpm at selenic.com
Wed Oct 19 17:20:54 CDT 2011


On Wed, 2011-10-19 at 12:27 +0200, pierre-yves.david at logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1319019552 -7200
> # Node ID 678353d217a1b96d3771cac1c6e81ca831d6546b
> # Parent  e1395c636c0e7e783e77158f1fb8dc1e610cb209
> phases: marked content of a changegroup as published
> 
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -1956,10 +1956,12 @@ class localrepository(repo.repository):
>                  p = lambda: cl.writepending() and self.root or ""
>                  self.hook('pretxnchangegroup', throw=True,
>                            node=hex(cl.node(clstart)), source=srctype,
>                            url=url, pending=p)
>  
> +            added = [cl.node(r) for r in xrange(clstart, clend)]
> +            phases.moveboundary(self, 0, added)
>              # make changelog see real files again
>              cl.finalize(trp)
>  
>              tr.close()
>          finally:
> @@ -1972,13 +1974,12 @@ class localrepository(repo.repository):
>              self.ui.debug("updating the branch cache\n")
>              self.updatebranchcache()
>              self.hook("changegroup", node=hex(cl.node(clstart)),
>                        source=srctype, url=url)
>  
> -            for i in xrange(clstart, clend):
> -                self.hook("incoming", node=hex(cl.node(i)),
> -                          source=srctype, url=url)
> +            for n in added:
> +                self.hook("incoming", node=hex(n), source=srctype, url=url)

Note: we'll probably eventually want a way to hook into phase
transitions.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list