~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-27 06:10:18 UTC
  • mfrom: (3309 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20080327061018-dxztpxyv6yoeg3am
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        return klass(revision_id, t.as_sha1(), time, timezone, target_branch,
137
137
            patch, patch_type, public_branch, message)
138
138
 
 
139
    def get_disk_name(self, branch):
 
140
        """Generate a suitable basename for storing this directive on disk
 
141
 
 
142
        :param branch: The Branch this merge directive was generated fro
 
143
        :return: A string
 
144
        """
 
145
        revno, revision_id = branch.last_revision_info()
 
146
        if self.revision_id == revision_id:
 
147
            revno = [revno]
 
148
        else:
 
149
            revno = branch.get_revision_id_to_revno_map().get(self.revision_id,
 
150
                ['merge'])
 
151
        return '%s-%s' % (branch.nick, '.'.join(str(n) for n in revno))
 
152
 
139
153
    @staticmethod
140
154
    def _generate_diff(repository, revision_id, ancestor_id):
141
155
        tree_1 = repository.revision_tree(ancestor_id)