Patchwork largefiles: allow use of urls with #revision

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 27, 2013, 4:56 p.m.
Message ID <0a07c012c7df3c7f4cb7.1359305768@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/743/
State Accepted
Commit f1700480bef7a5696cc46125b5c1a9d651d0a3a7
Headers show

Comments

Mads Kiilerich - Jan. 27, 2013, 4:56 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1359305402 -3600
# Branch stable
# Node ID 0a07c012c7df3c7f4cb77c33092241fc1916b279
# Parent  886936ecc21bed5e9bc1a244b22f4b203d3c3ace
largefiles: allow use of urls with #revision

largefiles tried to create a peer directly with the specified path. That caused
  abort: unsupported URL component: "..."
if a revision was specified in the url.

The branch name do not matter for largefiles' use of remote peers. Largefiles
will be shared among all branches anyway.
Mads Kiilerich - Jan. 28, 2013, 2:30 p.m.
On 01/27/2013 06:21 PM, Kevin Bullock wrote:
> On 27 Jan 2013, at 10:56 AM, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <mads@kiilerich.com>
>> # Date 1359305402 -3600
>> # Branch stable
>> # Node ID 0a07c012c7df3c7f4cb77c33092241fc1916b279
>> # Parent  886936ecc21bed5e9bc1a244b22f4b203d3c3ace
>> largefiles: allow use of urls with #revision
> LGTM
>

Thanks, pushed to crew

/Mads

Patch

diff --git a/hgext/largefiles/basestore.py b/hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py
+++ b/hgext/largefiles/basestore.py
@@ -163,6 +163,7 @@  def _openstore(repo, remote=None, put=Fa
             path = ''
             remote = repo
         else:
+            path, _branches = hg.parseurl(path)
             remote = hg.peer(repo, {}, path)
 
     # The path could be a scheme so use Mercurial's normal functionality
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -1531,7 +1531,7 @@  Push a largefiles repository to a served
   >   --config 'web.allow_push=*' --config web.push_ssl=False
   $ cat hg.pid >> $DAEMON_PIDS
   $ rm "${USERCACHE}"/*
-  $ hg push -R r8 http://localhost:$HGPORT2
+  $ hg push -R r8 http://localhost:$HGPORT2/#default
   pushing to http://localhost:$HGPORT2/
   searching for changes
   searching for changes
@@ -1542,7 +1542,7 @@  Push a largefiles repository to a served
 
 Clone over http, with largefiles being pulled on update, not on clone.
 
-  $ hg clone -q http://localhost:$HGPORT2/ http-clone -U
+  $ hg clone -q http://localhost:$HGPORT2/#default http-clone -U
 
   $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
   resolving manifests