Patchwork debugssl: allow a URL to be specified without a local repository

login
register
mail settings
Submitter Matt Harbison
Date Aug. 31, 2017, 5:10 p.m.
Message ID <de15a760e994c378dfd5.1504199445@MATT7H-PC.attotech.com>
Download mbox | patch
Permalink /patch/23545/
State Accepted
Headers show

Comments

Matt Harbison - Aug. 31, 2017, 5:10 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1504039090 14400
#      Tue Aug 29 16:38:10 2017 -0400
# Branch stable
# Node ID de15a760e994c378dfd56d9d63a68af6c091a525
# Parent  5707bfe04deb953cd4d031c2ff099ac6a2bff6d2
debugssl: allow a URL to be specified without a local repository

This was the original intent, but I bungled the logic.  Otherwise if there is a
certificate chain issue, the repository can't be cloned in order for there to be
a repo object.  I think I missed this case because I was inside of a Mercurial
clone as I was originally developing and testing this.
Augie Fackler - Aug. 31, 2017, 7:25 p.m.
On Thu, Aug 31, 2017 at 01:10:45PM -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1504039090 14400
> #      Tue Aug 29 16:38:10 2017 -0400
> # Branch stable
> # Node ID de15a760e994c378dfd56d9d63a68af6c091a525
> # Parent  5707bfe04deb953cd4d031c2ff099ac6a2bff6d2
> debugssl: allow a URL to be specified without a local repository

queued, thanks (for stable)

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2078,10 +2078,10 @@  def debugssl(ui, repo, source=None, **op
                             'Windows'))
 
     if not source:
+        if not repo:
+            raise error.Abort(_("there is no Mercurial repository here, and no "
+                                "server specified"))
         source = "default"
-    elif not repo:
-        raise error.Abort(_("there is no Mercurial repository here, and no "
-                            "server specified"))
 
     source, branches = hg.parseurl(ui.expandpath(source))
     url = util.url(source)