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

mv.py 586B

123456789101112131415161718192021222324252627282930
  1. import subprocess
  2. from utilities import isGit, isMercurial, isBazaar
  3. def mv(arguments):
  4. '''
  5. Move file(s)
  6. '''
  7. if isGit():
  8. command = ["git", "mv"]
  9. command.extend(arguments)
  10. executeCommand(command)
  11. if isMercurial():
  12. command = ["hg", "mv"]
  13. command.extend(arguments)
  14. executeCommand(command)
  15. if isBazaar():
  16. command = ["bzr", "mv"]
  17. command.extend(arguments)
  18. executeCommand(command)
  19. def executeCommand(command):
  20. '''
  21. Execute the given command.
  22. '''
  23. subprocess.call(command)