vcs-mirror r7 - in trunk: . actions



Author: johncarr
Date: Fri Aug 22 14:44:43 2008
New Revision: 7
URL: http://svn.gnome.org/viewvc/vcs-mirror?rev=7&view=rev

Log:
Add hg mirror. Update mirror.py to match what is on *-mirror.gnome.org

Added:
   trunk/actions/hg-create.sh   (contents, props changed)
   trunk/actions/hg-update.sh   (contents, props changed)
Modified:
   trunk/mirror.py

Added: trunk/actions/hg-create.sh
==============================================================================
--- (empty file)
+++ trunk/actions/hg-create.sh	Fri Aug 22 14:44:43 2008
@@ -0,0 +1,5 @@
+#!/bin/sh
+MODULE=$1
+hg convert /srv/svn/$MODULE /srv/hg/$MODULE
+cd /srv/hg/$MODULE
+hg up -r null

Added: trunk/actions/hg-update.sh
==============================================================================
--- (empty file)
+++ trunk/actions/hg-update.sh	Fri Aug 22 14:44:43 2008
@@ -0,0 +1,5 @@
+#!/bin/sh
+MODULE=$1
+hg convert /srv/svn/$MODULE /srv/hg/$MODULE
+cd /srv/hg/$MODULE
+hg up -r null

Modified: trunk/mirror.py
==============================================================================
--- trunk/mirror.py	(original)
+++ trunk/mirror.py	Fri Aug 22 14:44:43 2008
@@ -10,7 +10,6 @@
         self.cur_dir = os.path.join(self.maildir, "cur")
 
 	self.queue = []
-        self.handled = []
 
         self.probe()
 
@@ -29,8 +28,12 @@
            new_path = os.path.join(self.cur_dir, f)
            if os.path.isfile(path):
                self.parse(path)
-               self.handled.append((path, new_path))
+               try:
+                   os.rename(path, new_path)
+               except:
+                   pass
         self.empty_queue()
+        print "queue be empty"
 
     def parse(self, path):
         f = open(path)
@@ -42,15 +45,9 @@
 
     def empty_queue(self):
         for module in self.queue:
-	    for vcs in ("svn", "bzr", "git"):
+	    for vcs in ("svn", "bzr", "git", "hg"):
 	        self.update(vcs, module)
 	self.queue = []
-        for path, new_path in self.handled:
-            try:
-                os.rename(path, new_path)
-            except:
-                pass
-        self.handled = []
 
     def update(self, vcs, module):
         moddir = os.path.join("/srv", vcs, module)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]