diff util.py @ 140:9ffde8662967

util: Add a command to normalize svn urls and use it in a couple of places. Test that it works and prevents failed assertions.
author Augie Fackler <durin42@gmail.com>
date Thu, 11 Dec 2008 20:41:57 -0600
parents 291925677a9f
children 1fde85a10f9e
line wrap: on
line diff
--- a/util.py
+++ b/util.py
@@ -23,6 +23,12 @@ def generate_help():
     return "\n".join(ret) + '\n'
 
 
+def normalize_url(svn_url):
+    while svn_url[-1] == '/':
+        svn_url = svn_url[:-1]
+    return svn_url
+
+
 def wipe_all_files(hg_wc_path):
     files = [f for f in os.listdir(hg_wc_path) if f != '.hg']
     for f in files:
@@ -69,10 +75,10 @@ def parse_revmap(revmap_filename):
 class PrefixMatch(object):
     def __init__(self, prefix):
         self.p = prefix
-    
+
     def files(self):
         return []
-    
+
     def __call__(self, fn):
         return fn.startswith(self.p)