~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2006-02-01 03:37:33 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060201033733-df5441ce73162009
Got selftest passing with storage API

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    delta = compare_trees(old_tree, new_tree, want_unchanged=False)
64
64
    return not delta.has_changed(), non_source
65
65
 
66
 
def set_pull_data(br, location, rev_id):
67
 
    pull_file = file (br.controlfilename("x-pull-data"), "wb")
68
 
    pull_file.write("%s\n%s\n" % (location, rev_id))
69
 
 
70
 
def get_pull_data(br):
71
 
    """
72
 
    >>> br = temp_branch()
73
 
    >>> get_pull_data(br)
74
 
    (None, None)
75
 
    >>> set_pull_data(br, 'http://somewhere', '888-777')
76
 
    >>> get_pull_data(br)
77
 
    ('http://somewhere', '888-777')
78
 
    >>> rm_branch(br)
79
 
    """
80
 
    filename = br.controlfilename("x-pull-data")
81
 
    if not os.path.exists(filename):
82
 
        return (None, None)
83
 
    pull_file = file (filename, "rb")
84
 
    location, rev_id = [f.rstrip('\n') for f in pull_file]
85
 
    return location, rev_id
86
 
 
87
66
def set_push_data(br, location):
88
 
    push_file = file (br.controlfilename("x-push-data"), "wb")
 
67
    push_file = file (br.control_files.controlfilename("x-push-data"), "wb")
89
68
    push_file.write("%s\n" % location)
90
69
 
91
70
def get_push_data(br):
98
77
    'http://somewhere'
99
78
    >>> rm_branch(br)
100
79
    """
101
 
    filename = br.controlfilename("x-push-data")
 
80
    filename = br.control_files.controlfilename("x-push-data")
102
81
    if not os.path.exists(filename):
103
82
        return None
104
83
    push_file = file (filename, "rb")