~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: Aaron Bentley
  • Date: 2006-06-16 22:29:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1790.
  • Revision ID: abentley@panoramicfeedback.com-20060616222903-11cbab3e10501076
Use parent branch as default base branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
from bzrlib.revision import (common_ancestor, MultipleRevisionSources,
16
16
                             NULL_REVISION)
17
17
from bzrlib.revisionspec import RevisionSpec
 
18
from bzrlib.trace import note
18
19
 
19
20
 
20
21
class cmd_send_changeset(Command):
86
87
        from bzrlib import user_encoding
87
88
        from bzrlib.bundle.serializer import write_bundle
88
89
 
 
90
        target_branch = Branch.open_containing(u'.')[0]
 
91
 
89
92
        if base is None:
90
 
            base_branch = None
91
 
        else:
92
 
            base_branch = Branch.open(base)
 
93
            base = target_branch.get_parent()
 
94
            if base is None:
 
95
                raise errors.BzrCommandError("No base branch known or"
 
96
                                             " specified.")
 
97
            else:
 
98
                note('Using saved location: %s' % base)
 
99
        base_branch = Branch.open(base)
93
100
 
94
101
        # We don't want to lock the same branch across
95
102
        # 2 different branches
96
 
        target_branch = Branch.open_containing(u'.')[0]
97
 
        if base_branch is not None and target_branch.base == base_branch.base:
98
 
            base_branch = None
 
103
        if target_branch.base == base_branch.base:
 
104
            base_branch = target_branch 
99
105
 
100
106
        base_revision = None
101
107
        if revision is None: