]> asedeno.scripts.mit.edu Git - git-svn-keywords.git/commitdiff
Just scan known locations, searching refs
authorAlejandro R. Sedeño <asedeno@mit.edu>
Tue, 9 Feb 2010 17:24:49 +0000 (12:24 -0500)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Tue, 9 Feb 2010 17:24:49 +0000 (12:24 -0500)
git-svn-keywords.py

index 05ff7584b25e67ebf8e21f1d8993b27800e362ee..dd2ec130dd77c6227b934ddc798ba049312574da 100755 (executable)
@@ -111,12 +111,14 @@ def parse_svn_unhandled(g):
         if CONFIG.has_option('core', 'lastrev'):
             lastrev = CONFIG.getint('core', 'lastrev')
 
-    try:
-        with open(g.path + '/svn/refs/remotes/git-svn/unhandled.log', 'r') as f:
-            _do_parse_unhandled(f, lastrev=lastrev)
-    except IOError:
-        with open(g.path + '/svn/git-svn/unhandled.log', 'r') as f:
-            _do_parse_unhandled(f, lastrev=lastrev)
+    for remote in ['svn', 'svn/refs/remotes']:
+        base = os.path.join(g.path,remote)
+        for d in os.listdir(base):
+            if os.path.isdir(os.path.join(base,d)):
+                unhandled = os.path.join(base,d,'unhandled.log')
+                if os.path.isfile(unhandled):
+                    with open(unhandled, 'r') as f:
+                        _do_parse_unhandled(f, lastrev=lastrev)
 
     with open(FILES_PATH, 'wb') as f:
         FILES.write(f)