~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to zap.py

  • Committer: Aaron Bentley
  • Date: 2007-07-12 13:50:21 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070712135021-yaszj8162d9dm71d
Adjust to use NULL_REVISION in API

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from shutil import rmtree
2
2
 
3
 
from bzrlib import bzrdir
 
3
from bzrlib import (
 
4
    bzrdir,
 
5
    revision as _mod_revision,
 
6
    )
4
7
from bzrlib.branch import Branch
5
8
from bzrlib.errors import NoWorkingTree, NotLocalUrl, NotBranchError
6
9
from bzrlib.workingtree import WorkingTree
28
31
        if parent_loc is None:
29
32
            raise NoParent()
30
33
        parent = Branch.open(parent_loc)
31
 
        p_ancestry = parent.repository.get_ancestry(parent.last_revision())
32
 
        if branch.last_revision() not in p_ancestry:
 
34
        last_revision = _mod_revision.ensure_null(parent.last_revision())
 
35
        p_ancestry = parent.repository.get_ancestry(last_revision)
 
36
        if (last_revision != _mod_revision.NULL_REVISION and
 
37
            branch.last_revision() not in p_ancestry):
33
38
            raise ParentMissingRevisions(branch.get_parent())
34
39
    rmtree(path)
35
40
    if remove_branch: