~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2007-01-15 15:19:20 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070115151920-pb4eto22dzk34co2
Add --silent option to patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    (True, [])
59
59
    >>> rm_tree(tree)
60
60
    """
61
 
    from bzrlib.diff import compare_trees
62
61
    old_tree = cur_tree.basis_tree()
63
62
    new_tree = cur_tree
64
63
    non_source = []
65
64
    for path, file_class, kind, file_id, entry in new_tree.list_files():
66
65
        if file_class in ('?', 'I'):
67
66
            non_source.append(path)
68
 
    delta = compare_trees(old_tree, new_tree, want_unchanged=False)
 
67
    delta = new_tree.changes_from(old_tree, want_unchanged=False)
69
68
    return not delta.has_changed(), non_source
70
69
 
71
70
def set_push_data(tree, location):
250
249
    if push_location is None:
251
250
        raise BzrCommandError("No rspush location known or specified.")
252
251
 
 
252
    if (push_location.find('::') != -1):
 
253
        usessh=False
 
254
    else:
 
255
        usessh=True
 
256
 
253
257
    if (push_location.find('://') != -1 or
254
258
        push_location.find(':') == -1):
255
259
        raise BzrCommandError("Invalid rsync path %r." % push_location)
284
288
                " specified location.  Please ensure that"
285
289
                ' "%s" is of the form "machine:/path".' % push_location)
286
290
    print "Pushing to %s" % push_location
287
 
    rsync(tree.basedir+'/', push_location, ssh=True, 
 
291
    rsync(tree.basedir+'/', push_location, ssh=usessh, 
288
292
          excludes=final_exclusions)
289
293
 
290
294
    set_push_data(tree, push_location)