from wizard import deploy
from wizard import shell
-
-import _base
-import wizard
+from wizard.command import _base
class Error(_base.Error):
"""Base exception for all exceptions raised by migrate"""
def __str__(self):
return """
-ERROR: Directory already contains a .git directory.
-Did you already migrate it?
+ERROR: Directory already contains a .git and/or
+.scripts directory. Did you already migrate it?
"""
class NotAutoinstallError(Error):
# create repository
sh.call("git", "--git-dir=.git", "init")
did_git_init = True
+ # configure our alternates (to save space and make this quick)
+ alternates = open(".git/objects/info/alternates", "w")
+ alternates.write(os.path.join(repo, "objects"))
+ alternates.close()
# configure our remote
sh.call("git", "remote", "add", "origin", repo)
# configure what would normally be set up on a 'git clone' for consistency
# XXX: setup .scripts/version???
# for verbose purposes, give us a git status and git diff
if options.verbose:
- sh.call("git", "status")
- sh.call("git", "diff")
+ try:
+ sh.call("git", "status")
+ except shell.CalledProcessError:
+ pass
+ try:
+ sh.call("git", "diff")
+ except shell.CalledProcessError:
+ pass
except:
# this... is pretty bad
logger.critical("ERROR: Exception detected! Rolling back...")