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

add.py 645B

123456789101112131415161718192021222324252627
  1. from utilities import execute, isGit, isMercurial, isBazaar
  2. def add(arguments):
  3. '''
  4. Add file(s) to the pending changes.
  5. '''
  6. if isGit():
  7. # If no additional arguments were passed assume
  8. # we want to add all pending changes.
  9. if len(arguments) == 0:
  10. arguments.append(".")
  11. command = ["git", "add"]
  12. command.extend(arguments)
  13. execute(command)
  14. if isMercurial():
  15. command = ["hg", "add"]
  16. command.extend(arguments)
  17. execute(command)
  18. if isBazaar():
  19. command = ["bzr", "add"]
  20. command.extend(arguments)
  21. execute(command)