Patchwork [6,of,6] locarepo: remove the `push` method

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 25, 2014, 6:46 p.m.
Message ID <2b7fdbb82a100550e217.1411670807@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5986/
State Changes Requested
Headers show

Comments

Pierre-Yves David - Sept. 25, 2014, 6:46 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1411634604 25200
#      Thu Sep 25 01:43:24 2014 -0700
# Node ID 2b7fdbb82a100550e2171280c10ab4221f2d6962
# Parent  3cf57b53c3cfbc9933bb0a46eb8814aac9897ac0
locarepo: remove the `push` method

All the logic of this function is in the exchange.push function for some time.
We just stop calling `localrepo.push` in `command.push` to have access to more
information. Leaving `localrepo.push` in place will let third party extensions
wrap it but it would never be called by `hg push` making the wrapping useless.
Therefore, the method is removed so that third party codes fail noisily and
get properly upgraded.
Augie Fackler - Oct. 3, 2014, 6:54 p.m.
On Thu, Sep 25, 2014 at 11:46:47AM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1411634604 25200
> #      Thu Sep 25 01:43:24 2014 -0700
> # Node ID 2b7fdbb82a100550e2171280c10ab4221f2d6962
> # Parent  3cf57b53c3cfbc9933bb0a46eb8814aac9897ac0
> locarepo: remove the `push` method

For patchbot, these appear to be pushed now.

>
> All the logic of this function is in the exchange.push function for some time.
> We just stop calling `localrepo.push` in `command.push` to have access to more
> information. Leaving `localrepo.push` in place will let third party extensions
> wrap it but it would never be called by `hg push` making the wrapping useless.
> Therefore, the method is removed so that third party codes fail noisily and
> get properly upgraded.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -1589,13 +1589,10 @@ class localrepository(object):
>          """Return util.hooks consists of "(repo, remote, outgoing)"
>          functions, which are called before pushing changesets.
>          """
>          return util.hooks()
>
> -    def push(self, remote, force=False, revs=None, newbranch=False):
> -        return exchange.push(self, remote, force, revs, newbranch).cgresult
> -
>      def stream_in(self, remote, requirements):
>          lock = self.lock()
>          try:
>              # Save remote branchmap. We will use it later
>              # to speed up branchcache creation
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1589,13 +1589,10 @@  class localrepository(object):
         """Return util.hooks consists of "(repo, remote, outgoing)"
         functions, which are called before pushing changesets.
         """
         return util.hooks()
 
-    def push(self, remote, force=False, revs=None, newbranch=False):
-        return exchange.push(self, remote, force, revs, newbranch).cgresult
-
     def stream_in(self, remote, requirements):
         lock = self.lock()
         try:
             # Save remote branchmap. We will use it later
             # to speed up branchcache creation