~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 16:16:56 UTC
  • mto: (147.2.17)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: abentley@panoramicfeedback.com-20050929161656-0aa948c2f00f3655
Fixed import issues w/ PyBaz

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