[PATCH] fall back to default if default-push is undefined

Brendan Cully brendan at kublai.com
Fri Jun 23 17:32:04 CDT 2006


Self-explanatory I believe...
-------------- next part --------------
# HG changeset patch
# User Brendan Cully <brendan at kublai.com>
# Node ID 4d0b46a2602c17a934c57742da6ca952f9481281
# Parent  041363739ca8abbcafce8d7418afc8dac733f764
Fall back to default if default-push is undefined

diff -r 041363739ca8 -r 4d0b46a2602c mercurial/ui.py
--- a/mercurial/ui.py	Fri Jun 23 08:10:06 2006 +0200
+++ b/mercurial/ui.py	Fri Jun 23 15:30:43 2006 -0700
@@ -202,7 +202,12 @@ class ui(object):
         if loc.find("://") != -1 or os.path.exists(loc):
             return loc
 
-        return self.config("paths", loc, loc)
+        result = self.config("paths", loc, loc)
+        if result == 'default-push':
+            result = self.config("paths", 'default', 'default')
+            if result == 'default':
+                result = loc
+        return result
 
     def write(self, *args):
         if self.header:


More information about the Mercurial mailing list