~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2005-12-03 20:42:25 UTC
  • mfrom: (147.4.25 trunk)
  • mto: (147.4.27 trunk)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: aaron.bentley@utoronto.ca-20051203204225-25678bc921de4fc1
MergeĀ fromĀ lifeless

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'])
46
 
    >>> bzrlib.add.smart_add_branch(br, [br.base])
47
 
    1
 
45
    (True, [u'foo'])
 
46
    >>> br.working_tree().add(["foo"])
48
47
    >>> is_clean(br)
49
48
    (False, [])
50
 
    >>> br.commit("added file")
51
 
    added foo
 
49
    >>> br.working_tree().commit("added file")
52
50
    >>> is_clean(br)
53
51
    (True, [])
54
52
    >>> rm_branch(br)
57
55
    old_tree = cur_branch.basis_tree()
58
56
    new_tree = cur_branch.working_tree()
59
57
    non_source = []
60
 
    for path, file_class, kind, file_id in new_tree.list_files():
 
58
    for path, file_class, kind, file_id, entry in new_tree.list_files():
61
59
        if file_class in ('?', 'I'):
62
60
            non_source.append(path)
63
61
    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 
 
62
    return not delta.has_changed(), non_source
68
63
 
69
64
def set_pull_data(br, location, rev_id):
70
65
    pull_file = file (br.controlfilename("x-pull-data"), "wb")
259
254
        push_location = location
260
255
    
261
256
    if push_location is None:
262
 
        print "No push location saved.  Please specify one on the command line."
263
 
        sys.exit(1)
 
257
        raise bzrlib.errors.MustUseDecorated
 
258
 
 
259
    if push_location.find('://') != -1:
 
260
        raise bzrlib.errors.MustUseDecorated
 
261
 
 
262
    if push_location.find(':') == -1:
 
263
        raise bzrlib.errors.MustUseDecorated
264
264
 
265
265
    clean, non_source = is_clean(cur_branch)
266
266
    if not clean: