~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: John Arbash Meinel
  • Date: 2007-07-13 02:23:34 UTC
  • mfrom: (2592 +trunk) (2612 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2614.
  • Revision ID: john@arbash-meinel.com-20070713022334-qb6ewgo6v4251yd9
[merge] bzr.dev 2612

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        - Bundle to transform A into B
98
98
    """
99
99
    takes_options = ['revision', 'remember',
100
 
                     Option("output", help="write bundle to specified file",
101
 
                            type=unicode)]
 
100
                     Option("output",
 
101
                            help="Write bundle to specified file.",
 
102
                            type=unicode),
 
103
                     ]
102
104
    takes_args = ['base?']
103
105
    aliases = ['bundle']
104
106
    encoding_type = 'exact'
115
117
            base_specified = True
116
118
 
117
119
        if revision is None:
118
 
            target_revision = target_branch.last_revision()
 
120
            target_revision = _mod_revision.ensure_null(
 
121
                target_branch.last_revision())
119
122
        elif len(revision) < 3:
120
123
            target_revision = revision[-1].in_history(target_branch).rev_id
121
124
            if len(revision) == 2:
153
156
                elif remember:
154
157
                    raise errors.BzrCommandError('--remember requires a branch'
155
158
                                                 ' to be specified.')
 
159
            base_last_revision = _mod_revision.ensure_null(
 
160
                base_branch.last_revision())
156
161
            target_branch.repository.fetch(base_branch.repository, 
157
 
                                           base_branch.last_revision())
 
162
                base_last_revision)
158
163
            graph = target_branch.repository.get_graph()
159
 
            base_revision = graph.find_unique_lca(
160
 
                _mod_revision.ensure_null(base_branch.last_revision()),
161
 
                _mod_revision.ensure_null(target_revision))
 
164
            base_revision = graph.find_unique_lca(base_last_revision,
 
165
                                                  target_revision)
162
166
 
163
167
        if output is not None:
164
168
            fileobj = file(output, 'wb')