error pulling from symbolic repo

TK Soh teekaysoh at yahoo.com
Mon Aug 8 19:24:09 CDT 2005


--- TK Soh <teekaysoh at yahoo.com> wrote:
> --- Thomas Arendsen Hein <thomas at intevation.de> wrote:
> > % hg paths
> > default = selected
> > selected = bos
> > bos = http://www.serpentine.com/hg
> > tah = http://hg.intevation.org/mercurial-tah/
> > hg = http://selenic.com/hg
> > 
> > With your patch 'hg pull' would pull from subdirectory 'selected',
> > while 'hg pull selected' would pull from Bryan.
> > 
> > So you want recursive lookup of paths, but here one has to make sure
> > that no endless loop happens.
> 
> Agreed. Here's a quick hack on ui.expandpath(). Please comment.

I've made a patch out of this with a slight change:

# HG changeset patch
# User tksoh at users.sourceforge.net
# Node ID 24dab4e9e2ad6eca12be76c87b543a8868d24c53
# Parent  9c918287d10b4018e27f9148e247e68ff5fe952c
Fixed error when pulling from recursive symbolic repository name. 

By adding support of recursive symbolic repository names into
ui.expandpath().

diff -r 9c918287d10b -r 24dab4e9e2ad mercurial/ui.py
--- a/mercurial/ui.py	Thu Aug  4 21:31:25 2005
+++ b/mercurial/ui.py	Tue Aug  9 00:24:15 2005
@@ -56,7 +56,13 @@
         for name, path in self.configitems("paths"):
             paths[name] = path
 
-        return paths.get(loc, loc)
+        for i in range(len(paths)):
+            if paths.has_key(loc):
+                loc = paths[loc]
+            else:
+                break
+            
+        return loc
 
     def write(self, *args):
         for a in args:


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Mercurial mailing list