~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Aaron Bentley
  • Date: 2007-07-10 21:18:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2606.
  • Revision ID: abentley@panoramicfeedback.com-20070710211854-93ofaa70day2p8d3
Start eliminating the use of None to indicate null revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    ignores,
66
66
    merge,
67
67
    osutils,
 
68
    revision as _mod_revision,
68
69
    revisiontree,
69
70
    repository,
70
71
    textui,
1685
1686
        This is used to allow WorkingTree3 instances to not affect branch
1686
1687
        when their last revision is set.
1687
1688
        """
1688
 
        if new_revision is None:
 
1689
        if _mod_revision.is_null(new_revision):
1689
1690
            self.branch.set_revision_history([])
1690
1691
            return False
1691
1692
        try:
2031
2032
        try:
2032
2033
            last_rev = self.get_parent_ids()[0]
2033
2034
        except IndexError:
2034
 
            last_rev = None
 
2035
            last_rev = _mod_revision.NULL_REVISION
2035
2036
        if last_rev != self.branch.last_revision():
2036
2037
            # merge tree state up to new branch tip.
2037
2038
            basis = self.basis_tree()
2061
2062
            for parent in merges:
2062
2063
                parent_trees.append(
2063
2064
                    (parent, self.branch.repository.revision_tree(parent)))
2064
 
            if old_tip is not None:
 
2065
            if not _mod_revision.is_null(old_tip):
2065
2066
                parent_trees.append(
2066
2067
                    (old_tip, self.branch.repository.revision_tree(old_tip)))
2067
2068
            self.set_parent_trees(parent_trees)
2070
2071
            # the working tree had the same last-revision as the master
2071
2072
            # branch did. We may still have pivot local work from the local
2072
2073
            # branch into old_tip:
2073
 
            if old_tip is not None:
 
2074
            if not _mod_revision.is_null(old_tip):
2074
2075
                self.add_parent_tree_id(old_tip)
2075
 
        if old_tip and old_tip != last_rev:
 
2076
        if not _mod_revision.is_null(old_tip) and old_tip != last_rev:
2076
2077
            # our last revision was not the prior branch last revision
2077
2078
            # and we have converted that last revision to a pending merge.
2078
2079
            # base is somewhere between the branch tip now