~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzr-pull

  • Committer: Aaron Bentley
  • Date: 2005-05-26 13:29:54 UTC
  • Revision ID: abentley@troll-20050526132954-76953c12b0da8d04
Added overwrite parameter to bzr-pull

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
import os
21
21
import scriptlib
 
22
import optparse
22
23
 
23
24
cur_branch = Branch(".")
24
 
if len(sys.argv) > 1:
25
 
    location = sys.argv[1]
 
25
parser = optparse.OptionParser("bzr-pull [URL]")
 
26
parser.add_option("-o", "--overwrite", action="store_true", 
 
27
                                  dest="overwrite",
 
28
                                  help="Overwrite any local changes")
 
29
options, args = parser.parse_args(sys.argv[1:])
 
30
if len(args) > 0:
 
31
    location = args[0]
26
32
else:
27
33
    location = None
28
 
scriptlib.pull(cur_branch, location)
 
34
scriptlib.pull(cur_branch, location, options.overwrite)
29
35