import sys
import os, os.path
from gbp.config import (GbpOptionParser, GbpOptionGroup)
-from gbp.deb.git import DebianGitRepository
-from gbp.git import (GitRepository, GitRepositoryError)
+from gbp.git import GitRepositoryError
from gbp.errors import GbpError
import gbp.log
+try:
+ from gbp.deb.git import DebianGitRepository as GitRepository
+except ImportError:
+ from gbp.rpm.git import RpmGitRepository as GitRepository
def build_parser(name):
pass
try:
- repo = DebianGitRepository.clone(clone_to, source, options.depth,
- auto_name=auto_name)
+ repo = GitRepository.clone(clone_to, source, options.depth,
+ auto_name=auto_name)
os.chdir(repo.path)
# Reparse the config files of the cloned repository so we pick up the
from gbp.config import (GbpOptionParser, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import GitRepositoryError
-from gbp.deb.git import DebianGitRepository
import gbp.log
+try:
+ from gbp.deb.git import DebianGitRepository as GitRepository
+except ImportError:
+ from gbp.rpm.git import RpmGitRepository as GitRepository
def update_branch(branch, repo, options):
"""
gbp.log.setup(options.color, options.verbose, options.color_scheme)
try:
- repo = DebianGitRepository(os.path.curdir)
+ repo = GitRepository(os.path.curdir)
except GitRepositoryError:
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1