~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2005-11-11 17:43:12 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051111174312-1c627d82a07bf8fd
Added patch for tab-in-patch-filename support

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    >>> fooname = os.path.join(br.base, "foo")
43
43
    >>> file(fooname, "wb").write("bar")
44
44
    >>> is_clean(br)
45
 
    (True, ['foo'])
 
45
    (True, [u'foo'])
46
46
    >>> bzrlib.add.smart_add_branch(br, [br.base])
47
47
    1
48
48
    >>> is_clean(br)
49
49
    (False, [])
50
50
    >>> br.commit("added file")
51
 
    added foo
52
51
    >>> is_clean(br)
53
52
    (True, [])
54
53
    >>> rm_branch(br)
57
56
    old_tree = cur_branch.basis_tree()
58
57
    new_tree = cur_branch.working_tree()
59
58
    non_source = []
60
 
    for path, file_class, kind, file_id in new_tree.list_files():
 
59
    for path, file_class, kind, file_id, entry in new_tree.list_files():
61
60
        if file_class in ('?', 'I'):
62
61
            non_source.append(path)
63
62
    delta = compare_trees(old_tree, new_tree, want_unchanged=False)
64
 
    if len(delta.added) > 0 or len(delta.removed) > 0 or \
65
 
        len(delta.modified) > 0:
66
 
        return False, non_source
67
 
    return True, non_source 
 
63
    return not delta.has_changed(), non_source
68
64
 
69
65
def set_pull_data(br, location, rev_id):
70
66
    pull_file = file (br.controlfilename("x-pull-data"), "wb")
259
255
        push_location = location
260
256
    
261
257
    if push_location is None:
262
 
        print "No push location saved.  Please specify one on the command line."
263
 
        sys.exit(1)
 
258
        raise bzrlib.errors.MustUseDecorated
 
259
 
 
260
    if push_location.find('://') != -1:
 
261
        raise bzrlib.errors.MustUseDecorated
 
262
 
 
263
    if push_location.find(':') == -1:
 
264
        raise bzrlib.errors.MustUseDecorated
264
265
 
265
266
    clean, non_source = is_clean(cur_branch)
266
267
    if not clean: