~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2008-05-12 03:22:55 UTC
  • mfrom: (0.9.28 heads)
  • Revision ID: aaron@aaronbentley.com-20080512032255-gevqj6eos15kob0j
Merge in heads command

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