[Pkg-ocaml-maint-commits] r5618 - /trunk/tools/svn2git/glondu_svn2git.py

glondu-guest at users.alioth.debian.org glondu-guest at users.alioth.debian.org
Sat May 10 11:47:39 UTC 2008


Author: glondu-guest
Date: Sat May 10 11:47:39 2008
New Revision: 5618

URL: http://svn.debian.org/wsvn/?sc=1&rev=5618
Log:
Reading arguments on command line.

Modified:
    trunk/tools/svn2git/glondu_svn2git.py

Modified: trunk/tools/svn2git/glondu_svn2git.py
URL: http://svn.debian.org/wsvn/trunk/tools/svn2git/glondu_svn2git.py?rev=5618&op=diff
==============================================================================
--- trunk/tools/svn2git/glondu_svn2git.py (original)
+++ trunk/tools/svn2git/glondu_svn2git.py Sat May 10 11:47:39 2008
@@ -20,11 +20,12 @@
 svntag_re = re.compile(r"^\[svn-buildpackage\][^(]+\(([^)]+)\)$")
 
 
-# Mapping from alioth login to name and email
+# Mapping from alioth login to name and email (could be queried...)
 users_dict = {
     "glondu-guest": ("Stephane Glondu", "steph at glondu.net"),
     "smimram": ("Samuel Mimram", "smimram at debian.org"),
     "zack": ("Stefano Zacchiroli", "zack at debian.org"),
+    "gareuselesinge": ("Enrico Tassi", "gareuselesinge at debian.org"),
 }
 
 
@@ -108,6 +109,9 @@
             n = set(os.listdir(tarball_path)) - self.svn2git.seen
             if len(n) == 1:
                 tgz = n.pop()
+                if len(self.svn2git.seen) == 1 and os.path.exists("debian"):
+                    # Repository not empty and still no upstream branch
+                    run_command("git-branch", "git branch upstream")
                 print "New upstream tarball:", tgz
                 run_command("git-import-orig", "git-import-orig --pristine-tar --no-dch %s/%s" % (tarball_path, tgz))
                 self.svn2git.seen.add(tgz)
@@ -156,7 +160,7 @@
         os.chdir("..")
 
     def check_clean(self):
-        s, o = getstatusoutput("find svn|grep -vE '^svn($|/(.svn|upstream)($|/)|/trunk($|/(debian|\.svn)))'")
+        s, o = getstatusoutput("find svn|grep -vE '^svn($|/(.svn|upstream|tarballs)($|/)|/trunk($|/(debian|\.svn)))'")
         if not s:
             print "Unexpected content in svn repos:"
             print o
@@ -217,7 +221,21 @@
 
 
 if __name__ == "__main__":
-    run_command("clean", "rm -Rf git svn")
-    git_init()
-    a = Svn2Git("ocsigen", "upstream")
-    a.do(0)
+
+    if len(sys.argv) < 4:
+        print "Usage: %s <package-name> <tarball-location> <initial-revision>" % sys.argv[0]
+        sys.exit(1)
+
+    package_name = sys.argv[1]
+    tarball_location = sys.argv[2]
+    initial_revision = int(sys.argv[3])
+
+    if initial_revision == 0:
+        run_command("clean", "rm -Rf git svn")
+        git_init()
+
+    print "Retrieving logs...",
+    a = Svn2Git(package_name, tarball_location)
+    print "OK!"
+    print "Here we go!"
+    a.do(initial_revision)




More information about the Pkg-ocaml-maint-commits mailing list