~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to zap.py

  • Committer: Aaron Bentley
  • Date: 2007-06-17 21:58:21 UTC
  • mto: This revision was merged to the branch mainline in revision 548.
  • Revision ID: aaron.bentley@utoronto.ca-20070617215821-5r85khgnwhklihh9
Zap doesn't recommend upgrading trees it's about to delete

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
4
from bzrlib.branch import Branch
4
5
from bzrlib.errors import NoWorkingTree, NotLocalUrl, NotBranchError
5
6
from bzrlib.workingtree import WorkingTree
10
11
 
11
12
def zap(path, remove_branch=False):
12
13
    try:
13
 
        wt = WorkingTree.open(path)
 
14
        wt = bzrdir.BzrDir.open(path).open_workingtree(path,
 
15
                                                       recommend_upgrade=False)
14
16
    except (NoWorkingTree, NotBranchError):
15
17
        raise NotCheckout(path)
16
18
    tree_base = wt.bzrdir.transport.base