~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to gen_changeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-11 06:57:50 UTC
  • mto: (0.5.85) (1185.82.1 bzr-w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20050711065750-6da62e4042bd87e6
Working on test cases, starting with the empty project issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    """Find the best base revision based on ancestry.
66
66
    All revisions should already be pulled into the local tree.
67
67
    """
 
68
    if base_rev_id is None:
 
69
        # We have a complete changeset, None has to be the best base
 
70
        return None
68
71
    this_revs = _get_revision_set(target_branch, target_rev_id)
69
72
 
70
73
    # This does a breadth first search through history, looking for
105
108
    # exist in the revision history, we should already have
106
109
    # a valid listing of revision ancestry.
107
110
    rh = branch.revision_history()
 
111
    if ancestor_rev_id is None:
 
112
        rh.reverse()
 
113
        rh.append(None)
 
114
        return rh
 
115
 
108
116
    if ancestor_rev_id in rh and this_rev_id in rh:
109
117
        ancestor_idx = rh.index(ancestor_rev_id)
110
118
        this_rev_idx = rh.index(this_rev_id)
188
196
        self.base_branch = base_branch
189
197
        self.base_rev_id = base_rev_id
190
198
        self.base_tree = base_tree
191
 
        self.base_revision = self.base_branch.get_revision(self.base_rev_id)
 
199
        if self.base_rev_id is not None:
 
200
            self.base_revision = self.base_branch.get_revision(self.base_rev_id)
 
201
        else:
 
202
            self.base_revision = None
192
203
 
193
204
        self.target_branch = target_branch
194
205
        self.target_rev_id = target_rev_id