diff options
Diffstat (limited to 'slave/autotua/sync/__init__.py')
-rw-r--r-- | slave/autotua/sync/__init__.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/slave/autotua/sync/__init__.py b/slave/autotua/sync/__init__.py index 7ad356f..2a57651 100644 --- a/slave/autotua/sync/__init__.py +++ b/slave/autotua/sync/__init__.py @@ -62,11 +62,11 @@ class Syncer(object): elif self.scheme in ['git', 'bzr']: is_repo_cmd = None if self.scheme == 'git': - is_repo_cmd = 'git-rev-parse' + is_repo_cmd = 'git rev-parse' elif self.scheme == 'bzr': is_repo_cmd = 'bzr info' else: - raise 'Unknown scm: "%s"' % self.scheme + raise Exception('Unknown scm: "%s"' % self.scheme) result = subprocess.Popen('cd "%s"; %s' % (self.destdir, is_repo_cmd), shell=True) returncode = result.wait() if returncode != 0: @@ -81,8 +81,7 @@ class Syncer(object): """ if osp.exists(self.destdir): if not osp.isdir(self.destdir): - # FIXME: Custom exceptions - raise '"%s" exists and is not a directory' % self.destdir + raise Exception('"%s" exists and is not a directory' % self.destdir) result = self._is_repo() if result == ONLY_SYNC: self.command.run('init') @@ -92,7 +91,7 @@ class Syncer(object): shutil.rmtree(self.destdir) self.command.run('init') else: - raise 'Erm. I did not expect this. DIE DIE DIE.' + raise Exception('Erm. I did not expect this. DIE DIE DIE.') else: if not osp.exists(osp.dirname(self.destdir)): # Create parents @@ -130,14 +129,14 @@ class Command(object): if action == 'sync': return cmd+'git config remote.origin.url "$URI";git fetch -f -u origin master:master' elif self.scheme == 'git-export': # export self.rev - return 'git-archive --prefix="%s/" --remote="%s" "%s" | tar x -C "%s"' % \ + return 'git archive --prefix="%s/" --remote="%s" "%s" | tar x -C "%s"' % \ (osp.basename(self.destdir), self.uri, self.rev, osp.dirname(self.destdir)) elif self.scheme == 'rsync': # rsync, delete return 'rsync -a --delete-after "%s" "%s"' % (self.uri, self.destdir) elif self.scheme == 'rsync-nc': # rsync, no-clobber return 'rsync -a "%s" "%s"' % (self.uri, self.destdir) else: - raise "Unknown scheme: %s" % self.scheme + raise Exception("Unknown scheme: %s" % self.scheme) def run(self, action): """Run a sync command""" |