Issue2086

Title Problem setting default path when cloning from local-file scheme
Priority bug Status resolved
Superseder Nosy List brodie, cyanite, elwood, mpm, piranha, zondo
Assigned To Topics

Created on 2010-03-10.20:58:08 by zondo, last changed 2011-05-23.07:06:28 by zondo.

Files
File name Uploaded Type Edit Remove
file-scheme-bug.patch zondo, 2010-03-10.20:58:08 text/x-diff
scheme-fix.patch zondo, 2010-03-16.14:25:24 text/x-diff
Messages
msg16342 (view) Author: zondo Date: 2011-05-23.07:06:28
This appears to be fixed now in the default branch (changeset f90d5641c78b).
msg15985 (view) Author: mpm Date: 2011-04-06.19:00:42
Adding piranha and brodie, maybe they have opinions.
msg15978 (view) Author: elwood Date: 2011-04-06.12:46:17
I've been experiencing this bug as well.  I applied the patch mentioned and 
it works.  Any chance this or something like it can get included in the next 
release?
msg12078 (view) Author: zondo Date: 2010-03-18.12:07:06
Have cleaned up the patch, and will submit it to mercurial-devel.  Cheers
for the pointer.
msg12065 (view) Author: mpm Date: 2010-03-17.23:08:52
Please send all patches to the -devel list.
msg12057 (view) Author: zondo Date: 2010-03-16.14:25:24
Here's a better fix for the problem.  It checks for the specific case where
a local repo is specified using a scheme which doesn't look like a file://
scheme (i.e., from the schemes extension) and skips the abspath() step.
msg12016 (view) Author: zondo Date: 2010-03-11.14:08:24
I'm not convinced the problem you mention would actually be a problem.  To
even find the repo you're cloning using the scheme extension, you must have
it enabled and be using a scheme that points to the right repo.  Unless you
explicitly change that setup after cloning, what could go wrong?

Also, turning the repo path into a 'correct' local path defeats one of the
use cases for schemes: namely, the ability for an admin to alias the
location of a central bunch of local repos, so that if (for whatever reason)
they need to be moved, it can be done just by changing the (globally
defined) scheme, and users don't notice any difference.
msg12015 (view) Author: cyanite Date: 2010-03-11.11:50:05
One potential problem is that the schemes extension might be enabled in the 
source repository local configuration, and thus the cloned repo will have an 
invalid default path. There could be other problems with relative paths not 
being resolved etc.

A better solution might be to just produce a correct local path instead.
msg12008 (view) Author: zondo Date: 2010-03-10.20:58:08
There's a problem when cloning from a repo specified using the 'schemes'
extension.  If the scheme is a local file, the 'default' path in the clone's
.hg/hgrc is set incorrectly.  For example, suppose this is the setup in your
hgrc:

[extensions]
schemes = 

[schemes]
main = /path/to/repodirs

Running the command 'hg clone main://myrepo' from directory '/home/glenn'
(assuming myrepo exists in repodirs) results in a cloned repo with the
default path set to '/home/glenn:/myrepo' instead of 'main://myrepo' as
expected.

I've attached a patch which fixes this problem (but not entirely sure it
doesn't introduce others).
History
Date User Action Args
2011-05-23 07:06:28zondosetstatus: chatting -> resolved
nosy: mpm, piranha, cyanite, brodie, zondo, elwood
messages: + msg16342
2011-04-06 19:00:42mpmsetnosy: + piranha, brodie
messages: + msg15985
2011-04-06 12:46:17elwoodsetnosy: + elwood
messages: + msg15978
2010-03-18 12:07:06zondosetnosy: mpm, cyanite, zondo
messages: + msg12078
2010-03-17 23:08:52mpmsetnosy: + mpm
messages: + msg12065
2010-03-16 14:25:24zondosetfiles: + scheme-fix.patch
nosy: cyanite, zondo
messages: + msg12057
2010-03-11 14:08:24zondosetnosy: cyanite, zondo
messages: + msg12016
2010-03-11 11:50:05cyanitesetstatus: unread -> chatting
nosy: + cyanite
messages: + msg12015
2010-03-10 20:58:08zondocreate