Patchwork [1,of,3,v2] schemes: extract scheme expansion as its own method on ShortRepository

login
register
mail settings
Submitter Jason R. Coombs
Date Feb. 1, 2016, 2:09 p.m.
Message ID <315d5f0fdf71c4f173a0.1454335783@waste.org>
Download mbox | patch
Permalink /patch/12931/
State Superseded
Commit d630eac3a5dbaf33a12e23d65abeff4d54df9f10
Headers show

Comments

Jason R. Coombs - Feb. 1, 2016, 2:09 p.m.
# HG changeset patch
# User Jason R. Coombs <jaraco@jaraco.com>
# Date 1454096441 18000
#      Fri Jan 29 14:40:41 2016 -0500
# Node ID 315d5f0fdf71c4f173a09916d11133103fdbec1c
# Parent  d73a5ab18015f61ac61e6e77256512fd82b03818
schemes: extract scheme expansion as its own method on ShortRepository
Pierre-Yves David - Feb. 1, 2016, 3:38 p.m.
On 02/01/2016 02:09 PM, Jason R. Coombs wrote:
> # HG changeset patch
> # User Jason R. Coombs <jaraco@jaraco.com>
> # Date 1454096441 18000
> #      Fri Jan 29 14:40:41 2016 -0500
> # Node ID 315d5f0fdf71c4f173a09916d11133103fdbec1c
> # Parent  d73a5ab18015f61ac61e6e77256512fd82b03818
> schemes: extract scheme expansion as its own method on ShortRepository

Please hold on sending any feature patch until 3.7 is released and the 
freeze is lifted.

Thanks
Jason R. Coombs - Feb. 1, 2016, 6:37 p.m.
Please excuse the noise. I’m new to the process. I was directed to wait until Feb 1, which I did. I’ll watch the topic in #mercurial for an indication of the freeze lift.

> On 1 Feb, 2016, at 10:38, Pierre-Yves David <pierre-yves.david@ens-lyon.org> wrote:

> 

> 

> 

> On 02/01/2016 02:09 PM, Jason R. Coombs wrote:

>> # HG changeset patch

>> # User Jason R. Coombs <jaraco@jaraco.com>

>> # Date 1454096441 18000

>> #      Fri Jan 29 14:40:41 2016 -0500

>> # Node ID 315d5f0fdf71c4f173a09916d11133103fdbec1c

>> # Parent  d73a5ab18015f61ac61e6e77256512fd82b03818

>> schemes: extract scheme expansion as its own method on ShortRepository

> 

> Please hold on sending any feature patch until 3.7 is released and the freeze is lifted.

> 

> Thanks

> 

> -- 

> Pierre-Yves David

Patch

diff --git a/hgext/schemes.py b/hgext/schemes.py
--- a/hgext/schemes.py
+++ b/hgext/schemes.py
@@ -65,6 +65,10 @@ 
         return '<ShortRepository: %s>' % self.scheme
 
     def instance(self, ui, url, create):
+        url = self.resolve(ui, url)
+        return hg._peerlookup(url).instance(ui, url, create)
+
+    def resolve(self, ui, url):
         # Should this use the util.url class, or is manual parsing better?
         try:
             url = url.split('://', 1)[1]
@@ -77,8 +81,7 @@ 
         else:
             tail = ''
         context = dict((str(i + 1), v) for i, v in enumerate(parts))
-        url = ''.join(self.templater.process(self.url, context)) + tail
-        return hg._peerlookup(url).instance(ui, url, create)
+        return ''.join(self.templater.process(self.url, context)) + tail
 
 def hasdriveletter(orig, path):
     if path: