~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2007-03-01 06:40:30 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20070301064030-oephxy4vrkf8aene
turn is_clean doctests into unittest, to avoid creating .bazaar directories

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
def is_clean(cur_tree):
41
41
    """
42
42
    Return true if no files are modifed or unknown
43
 
    >>> import bzrlib.add
44
 
    >>> tree = temp_tree()
45
 
    >>> is_clean(tree)
46
 
    (True, [])
47
 
    >>> fooname = os.path.join(tree.basedir, "foo")
48
 
    >>> file(fooname, "wb").write("bar")
49
 
    >>> is_clean(tree)
50
 
    (True, [u'foo'])
51
 
    >>> bzrlib.add.smart_add_tree(tree, [tree.basedir])
52
 
    ([u'foo'], {})
53
 
    >>> is_clean(tree)
54
 
    (False, [])
55
 
    >>> tree.commit("added file", rev_id='commit-id')
56
 
    'commit-id'
57
 
    >>> is_clean(tree)
58
 
    (True, [])
59
 
    >>> rm_tree(tree)
60
43
    """
61
44
    old_tree = cur_tree.basis_tree()
62
45
    new_tree = cur_tree