~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to zap.py

  • Committer: Aaron Bentley
  • Date: 2007-06-19 16:32:20 UTC
  • mfrom: (544.1.1 bzrtools)
  • Revision ID: abentley@panoramicfeedback.com-20070619163220-eo0wa27sqa3ln37e
Merge zap fix

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