summaryrefslogtreecommitdiffstats
path: root/modules/darcs.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/darcs.py')
-rw-r--r--modules/darcs.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/darcs.py b/modules/darcs.py
new file mode 100644
index 0000000..4c73e02
--- /dev/null
+++ b/modules/darcs.py
@@ -0,0 +1,45 @@
+# Fedora Developer Shell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Authors: Yaakov M. Nemoy <ynemoy@redhat.com>
+#
+
+from __future__ import with_statement
+
+from subprocess import Popen
+
+from base.util import pwd, log
+from modules.revisioncontrol import RevisionControl
+
+class Darcs(RevisionControl):
+ _type = 'darcs'
+ def load_dir(self, dir):
+ super(RevisionControl, self).load_dir(dir)
+ self.vc_url = self.cfg['vc_url']
+
+ def source_dir(self, *args):
+ return self.cfg['source']
+
+ def checkout(self, tgt, url, *args):
+ with pwd(self.dir):
+ self.cfg['source'] = tgt
+ self.cfg['vc_url'] = url
+ with file('darcs.log', 'a') as darcs_out:
+ p = Popen(['darcs', 'get'] + list(args) + [url, tgt],
+ stdout = darcs_out, stderr = darcs_out)
+ log.info('darcs get %s %s, please wait....' % (url, tgt))
+ p.wait()
+
+ pass