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

merge.py 633B

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