~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2009-06-29 14:51:13 UTC
  • mfrom: (4489 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4490.
  • Revision ID: aaron@aaronbentley.com-20090629145113-3w350dxgqppnzo4g
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1044
1044
        if directory is None:
1045
1045
            directory = '.'
1046
1046
        # Get the source branch
1047
 
        tree, br_from = bzrdir.BzrDir.open_tree_or_branch(directory)
 
1047
        (tree, br_from,
 
1048
         _unused) = bzrdir.BzrDir.open_containing_tree_or_branch(directory)
1048
1049
        if strict is None:
1049
1050
            strict = br_from.get_config().get_user_option('push_strict')
1050
1051
            if strict is not None:
3603
3604
                if revision is not None and len(revision) > 0:
3604
3605
                    raise errors.BzrCommandError('Cannot use --uncommitted and'
3605
3606
                        ' --revision at the same time.')
3606
 
                location = self._select_branch_location(tree, location)[0]
3607
 
                other_tree, other_path = WorkingTree.open_containing(location)
3608
 
                merger = _mod_merge.Merger.from_uncommitted(tree, other_tree,
3609
 
                    pb)
 
3607
                merger = self.get_merger_from_uncommitted(tree, location, pb,
 
3608
                                                          cleanups)
3610
3609
                allow_pending = False
3611
 
                if other_path != '':
3612
 
                    merger.interesting_files = [other_path]
3613
3610
 
3614
3611
            if merger is None:
3615
3612
                merger, allow_pending = self._get_merger_from_branch(tree,
3728
3725
            allow_pending = True
3729
3726
        return merger, allow_pending
3730
3727
 
 
3728
    def get_merger_from_uncommitted(self, tree, location, pb, cleanups):
 
3729
        """Get a merger for uncommitted changes.
 
3730
 
 
3731
        :param tree: The tree the merger should apply to.
 
3732
        :param location: The location containing uncommitted changes.
 
3733
        :param pb: The progress bar to use for showing progress.
 
3734
        :param cleanups: A list of operations to perform to clean up the
 
3735
            temporary directories, unfinalized objects, etc.
 
3736
        """
 
3737
        location = self._select_branch_location(tree, location)[0]
 
3738
        other_tree, other_path = WorkingTree.open_containing(location)
 
3739
        merger = _mod_merge.Merger.from_uncommitted(tree, other_tree, pb)
 
3740
        if other_path != '':
 
3741
            merger.interesting_files = [other_path]
 
3742
        return merger
 
3743
 
3731
3744
    def _select_branch_location(self, tree, user_location, revision=None,
3732
3745
                                index=None):
3733
3746
        """Select a branch location, according to possible inputs.