[GRASS-SVN] r73494 - grass-addons/tools/svn2git

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 7 14:20:35 PDT 2018


Author: martinl
Date: 2018-10-07 14:20:35 -0700 (Sun, 07 Oct 2018)
New Revision: 73494

Modified:
   grass-addons/tools/svn2git/rewrite.py
Log:
svn2git: improve rewrite log script (work in progress)

Modified: grass-addons/tools/svn2git/rewrite.py
===================================================================
--- grass-addons/tools/svn2git/rewrite.py	2018-10-07 03:18:04 UTC (rev 73493)
+++ grass-addons/tools/svn2git/rewrite.py	2018-10-07 21:20:35 UTC (rev 73494)
@@ -5,9 +5,9 @@
 msg = sys.stdin.read()
 
 # Don't touch messages that reference other databases
-# if msg.find('MITAB bug ') >= 0 or msg.find('Safe bug ') >= 0 or msg.find('bugzilla') >= 0 or msg.find('Bugzilla') >= 0:
-#     sys.stdout.write(msg)
-#     sys.exit(0)
+if msg.find('RT bug ') >= 0:
+     sys.stdout.write(msg)
+     sys.exit(0)
 
 oldpos = 0
 old_msg = msg
@@ -74,7 +74,14 @@
             continue
 
         # check if ticket really exists
-        url = 'https://trac.osgeo.org/grass/ticket/' + msg[newpos+1:]
+        num = ''
+        while True:
+            if not(msg[newpos+1] >= '1' and msg[newpos+1] <= '9'):
+                break
+            num += msg[newpos+1]
+            newpos += 1
+        
+        url = 'https://trac.osgeo.org/grass/ticket/' + num
         request = requests.get(url)
         if request.status_code != 200:
             # does not exist
@@ -81,7 +88,7 @@
             oldpos = newpos + len(msg[newpos+1:])
             continue
 
-        msg = msg[0:newpos] + url
+        msg = msg[0:newpos-len(num)] + url + msg[newpos+1:]
         oldpos = newpos
         continue
 



More information about the grass-commit mailing list