/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        else:
149
149
            revno = branch.get_revision_id_to_revno_map().get(self.revision_id,
150
150
                ['merge'])
151
 
        return '%s-%s' % (branch.nick, '.'.join(str(n) for n in revno))
 
151
        nick = re.sub('(\W+)', '-', branch.nick).strip('-')
 
152
        return '%s-%s' % (nick, '.'.join(str(n) for n in revno))
152
153
 
153
154
    @staticmethod
154
155
    def _generate_diff(repository, revision_id, ancestor_id):
209
210
                except errors.RevisionNotPresent:
210
211
                    # At least one dependency isn't present.  Try installing
211
212
                    # missing revisions from the submit branch
212
 
                    submit_branch = _mod_branch.Branch.open(self.target_branch)
 
213
                    try:
 
214
                        submit_branch = \
 
215
                            _mod_branch.Branch.open(self.target_branch)
 
216
                    except errors.NotBranchError:
 
217
                        raise errors.TargetNotBranch(self.target_branch)
213
218
                    missing_revisions = []
214
219
                    bundle_revisions = set(r.revision_id for r in
215
220
                                           info.real_revisions)
273
278
        """
274
279
        _BaseMergeDirective.__init__(self, revision_id, testament_sha1, time,
275
280
            timezone, target_branch, patch, source_branch, message)
276
 
        assert patch_type in (None, 'diff', 'bundle'), patch_type
 
281
        if patch_type not in (None, 'diff', 'bundle'):
 
282
            raise ValueError(patch_type)
277
283
        if patch_type != 'bundle' and source_branch is None:
278
284
            raise errors.NoMergeSource()
279
285
        if patch_type is not None and patch is None: