diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-06 17:29:55 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-06 17:29:55 +0000 |
commit | c59d59a1ea2df5e8211a617936229b85993100d5 (patch) | |
tree | baa1e153327e02feb9c61ff5e984d492c17f0c36 | |
parent | 34f35bba7394345530d4f5124f127e3198ed678d (diff) | |
download | import-c59d59a1ea2df5e8211a617936229b85993100d5.tar.gz |
Some code has been merged with morphlib
This version of the import tool requires morph.git commit
6779e46e880eec757a6923441accef2442007677 or newer.
-rw-r--r-- | baserockimport/mainloop.py | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/baserockimport/mainloop.py b/baserockimport/mainloop.py index 5cb0323..b0f124c 100644 --- a/baserockimport/mainloop.py +++ b/baserockimport/mainloop.py @@ -27,32 +27,6 @@ import time import baserockimport -class GitDirectory(morphlib.gitdir.GitDirectory): - def __init__(self, dirname): - super(GitDirectory, self).__init__(dirname) - - # Work around strange/unintentional behaviour in GitDirectory class - # when 'repopath' isn't a Git repo. If 'repopath' is contained - # within a Git repo then the GitDirectory will traverse up to the - # parent repo, which isn't what we want in this case. - # - # FIXME: this should be a change to the base class, which should take - # a flag at construct time saying 'traverse_upwards_to_find_root' or - # some such. - if self.dirname != dirname: - logging.error( - 'Got git directory %s for %s!', self.dirname, dirname) - raise cliapp.AppException( - '%s is not the root of a Git repository' % dirname) - - def has_ref(self, ref): - try: - self._rev_parse(ref) - return True - except morphlib.gitdir.InvalidRefError: - return False - - class BaserockImportException(cliapp.AppException): pass @@ -413,7 +387,7 @@ class ImportLoop(object): ] for tag_name in possible_names: - if source_repo.has_ref(tag_name): + if source_repo.ref_exists(tag_name): source_repo.checkout(tag_name) ref = tag_name break |