Version control system wrapper allowing the developer to worry about only having to learn one command set to manage all types of repositories.

init.py 512B

123456789101112131415161718192021222324
  1. import subprocess
  2. from utilities import isGit, isMercurial, isBazaar
  3. def init(arguments):
  4. '''
  5. Initializes (or re-initializes) a repository.
  6. '''
  7. if "git" in arguments or isGit():
  8. executeCommand(["git", "init"])
  9. if "hg" in arguments or isMercurial():
  10. executeCommand(["hg", "init"])
  11. if "bzr" in arguments or isBazaar():
  12. executeCommand(["bzr", "init"])
  13. def executeCommand(command):
  14. '''
  15. Execute the given command.
  16. '''
  17. subprocess.call(command)