~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to zap.py

  • Committer: Aaron Bentley
  • Date: 2007-07-03 18:28:42 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070703182842-supfciy3ngzljqey
update PACKAGERS text

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
6
7
 
7
 
from errors import (NotCheckout, UncommittedCheckout, ParentMissingRevisions, 
 
8
from errors import (NotCheckout, UncommittedCheckout, ParentMissingRevisions,
8
9
                    NoParent)
9
10
 
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
41
43
def test_suite():
42
44
    import os
43
45
    from unittest import makeSuite
44
 
    
 
46
 
45
47
    from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1
46
48
    from bzrlib.branch import BranchReferenceFormat
47
49
    from bzrlib.tests import TestCaseInTempDir