~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-06 07:48:11 UTC
  • mfrom: (4335.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090506074811-dtxiv8kba5sez934
(igc) pull --local (Gary van der Merwe)

Show diffs side-by-side

added added

removed removed

Lines of Context:
882
882
            short_name='d',
883
883
            type=unicode,
884
884
            ),
 
885
        Option('local',
 
886
            help="Perform a local pull in a bound "
 
887
                 "branch.  Local pulls are not applied to "
 
888
                 "the master branch."
 
889
            ),
885
890
        ]
886
891
    takes_args = ['location?']
887
892
    encoding_type = 'replace'
888
893
 
889
894
    def run(self, location=None, remember=False, overwrite=False,
890
895
            revision=None, verbose=False,
891
 
            directory=None):
 
896
            directory=None, local=False):
892
897
        # FIXME: too much stuff is in the command class
893
898
        revision_id = None
894
899
        mergeable = None
900
905
        except errors.NoWorkingTree:
901
906
            tree_to = None
902
907
            branch_to = Branch.open_containing(directory)[0]
 
908
        
 
909
        if local and not branch_to.get_bound_location():
 
910
            raise errors.LocalRequiresBoundBranch()
903
911
 
904
912
        possible_transports = []
905
913
        if location is not None:
948
956
                    unversioned_filter=tree_to.is_ignored, view_info=view_info)
949
957
                result = tree_to.pull(branch_from, overwrite, revision_id,
950
958
                                      change_reporter,
951
 
                                      possible_transports=possible_transports)
 
959
                                      possible_transports=possible_transports,
 
960
                                      local=local)
952
961
            else:
953
 
                result = branch_to.pull(branch_from, overwrite, revision_id)
 
962
                result = branch_to.pull(branch_from, overwrite, revision_id,
 
963
                                      local=local)
954
964
 
955
965
            result.report(self.outf)
956
966
            if verbose and result.old_revid != result.new_revid: