[PATCH] largefiles: allow use of urls with #revision

Mads Kiilerich mads at kiilerich.com
Sun Jan 27 10:56:08 CST 2013


# HG changeset patch
# User Mads Kiilerich <mads at 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.

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


More information about the Mercurial-devel mailing list