~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2006-03-13 00:13:56 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060313001356-6aadd11700e1ac1f
MarkedĀ deprecationĀ bugs

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    return not delta.has_changed(), non_source
67
67
 
68
68
def set_push_data(tree, location):
69
 
    push_file = file (tree.branch.control_files.controlfilename("x-push-data"), "wb")
 
69
    push_file = file (tree._control_files.controlfilename("x-push-data"), "wb")
70
70
    push_file.write("%s\n" % location)
71
71
 
72
72
def get_push_data(tree):
79
79
    'http://somewhere'
80
80
    >>> rm_tree(tree)
81
81
    """
82
 
    filename = tree.branch.control_files.controlfilename("x-push-data")
 
82
    filename = tree._control_files.controlfilename("x-push-data")
83
83
    if not os.path.exists(filename):
84
84
        return None
85
85
    push_file = file (filename, "rb")
189
189
        raise RsyncUnknownStatus(proc.returncode)
190
190
    return [l.split(' ')[-1].rstrip('\n') for l in result.splitlines(True)]
191
191
 
192
 
exclusions = ('.bzr/x-push-data', '.bzr/branch/x-push/data', '.bzr/parent', 
193
 
              '.bzr/branch/parent', '.bzr/x-pull-data', '.bzr/x-pull',
194
 
              '.bzr/pull', '.bzr/stat-cache', '.bzr/x-rsync-data',
195
 
              '.bzr/basis-inventory', '.bzr/inventory.backup.weave')
 
192
exclusions = ('.bzr/x-push-data', '.bzr/parent', '.bzr/x-pull-data', 
 
193
              '.bzr/x-pull', '.bzr/pull', '.bzr/stat-cache',
 
194
              '.bzr/x-rsync-data', '.bzr/basis-inventory', 
 
195
              '.bzr/inventory.backup.weave')
196
196
 
197
197
 
198
198
def read_revision_history(fname):
211
211
    tempdir = tempfile.mkdtemp('push')
212
212
    try:
213
213
        history_fname = os.path.join(tempdir, 'revision-history')
214
 
        try:
215
 
            cmd = rsync(location+'.bzr/revision-history', history_fname,
216
 
                        silent=True)
217
 
        except RsyncNoFile:
218
 
            cmd = rsync(location+'.bzr/branch/revision-history', history_fname,
219
 
                        silent=True)
 
214
        cmd = rsync(location+'.bzr/revision-history', history_fname,
 
215
                    silent=True)
220
216
        history = read_revision_history(history_fname)
221
217
    finally:
222
218
        shutil.rmtree(tempdir)
258
254
    if push_location.find(':') == -1:
259
255
        raise bzrlib.errors.MustUseDecorated
260
256
 
 
257
    clean, non_source = is_clean(tree)
 
258
    if not clean:
 
259
        print """Error: This tree has uncommitted changes or unknown (?) files.
 
260
Use "bzr status" to list them."""
 
261
        sys.exit(1)
261
262
    if working_tree:
262
 
        clean, non_source = is_clean(tree)
263
 
        if not clean:
264
 
            print """Error: This tree has uncommitted changes or unknown (?) files.
265
 
    Use "bzr status" to list them."""
266
 
            sys.exit(1)
267
263
        final_exclusions = non_source[:]
268
264
    else:
269
265
        wt = tree