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

rm.py 614B

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