Patchwork [09,of,12,V2] hg: make "_outgoing()" return peer object for remote repository

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 15, 2014, 3:52 p.m.
Message ID <8808149819512acecf29.1397577150@juju>
Download mbox | patch
Permalink /patch/4368/
State Accepted
Commit 025ec0f08cb60ca50a5b342ccc006f7a8fa30ab2
Headers show

Comments

Katsunori FUJIWARA - April 15, 2014, 3:52 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1397576244 -32400
#      Wed Apr 16 00:37:24 2014 +0900
# Node ID 8808149819512acecf299d799b6925eb5ad8f6f0
# Parent  90e8731c7a427cc21b21cf4e588741ce02e9f726
hg: make "_outgoing()" return peer object for remote repository

This patch makes "_outgoing()" return peer object for remote
repository, to avoid re-execution "expandpath()", "parseurl()", and
"peer()" on caller side for specified URL.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4387,7 +4387,7 @@ 
     """
     if opts.get('graph'):
         cmdutil.checkunsupportedgraphflags([], opts)
-        o = hg._outgoing(ui, repo, dest, opts)
+        o, other = hg._outgoing(ui, repo, dest, opts)
         if not o:
             return
 
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -585,7 +585,7 @@ 
     o = outgoing.missing
     if not o:
         scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
-    return o
+    return o, other
 
 def outgoing(ui, repo, dest, opts):
     def recurse():
@@ -598,7 +598,7 @@ 
         return ret
 
     limit = cmdutil.loglimit(opts)
-    o = _outgoing(ui, repo, dest, opts)
+    o, other = _outgoing(ui, repo, dest, opts)
     if not o:
         return recurse()