~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Marius Kruger
  • Date: 2008-04-19 15:10:17 UTC
  • mto: This revision was merged to the branch mainline in revision 632.
  • Revision ID: amanic@gmail.com-20080419151017-klp7w1vlzj25ee10
in colorstring() call terminal.colorstring from one place,
to improve code readability

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    return not delta.has_changed(), non_source
66
66
 
67
67
def set_push_data(tree, location):
68
 
    tree.branch._transport.put_bytes("x-push-data", "%s\n" % location)
 
68
    tree.branch.control_files.put_utf8("x-push-data", "%s\n" % location)
69
69
 
70
70
def get_push_data(tree):
71
71
    """
78
78
    >>> rm_tree(tree)
79
79
    """
80
80
    try:
81
 
        location = tree.branch._transport.get('x-push-data').read()
 
81
        location = tree.branch.control_files.get_utf8('x-push-data').read()
82
82
    except NoSuchFile:
83
83
        return None
84
 
    location = location.decode('utf-8')
85
84
    return location.rstrip('\n')
86
85
 
87
86
"""
202
201
 
203
202
class NotStandalone(BzrError):
204
203
 
205
 
    _fmt = '%(location)s is not a standalone tree.'
 
204
    _format = '%(location) is not a standalone tree.'
206
205
    _internal = False
207
206
 
208
207
    def __init__(self, location):
408
407
def open_from_url(location):
409
408
    location = urlutils.normalize_url(location)
410
409
    dirname, basename = urlutils.split(location)
411
 
    if location.endswith('/') and not basename.endswith('/'):
412
 
        basename += '/'
413
410
    return get_transport(dirname).get(basename)
414
411
 
415
412