~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2006-06-06 08:09:09 UTC
  • mto: This revision was merged to the branch mainline in revision 1799.
  • Revision ID: mbp@sourcefrog.net-20060606080909-f7c9ea6defe2e751
Remove Scratch objects used by doctests

Some old doctests rely on special Scratch object which clean up
temporary directory when they're deleted.  This is a bit undesirable
because deletion is not predictable and the classes aren't used enough
to be worthwhile.

 * Remove ScratchBranch, ScratchDir, ScratchTransport, etc
 * Remove old doctests or convert to unittests
 * Incidental cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
        
301
301
        If self and other have not diverged, return a list of the revisions
302
302
        present in other, but missing from self.
303
 
 
304
 
        >>> from bzrlib.workingtree import WorkingTree
305
 
        >>> bzrlib.trace.silent = True
306
 
        >>> d1 = bzrdir.ScratchDir()
307
 
        >>> br1 = d1.open_branch()
308
 
        >>> wt1 = d1.open_workingtree()
309
 
        >>> d2 = bzrdir.ScratchDir()
310
 
        >>> br2 = d2.open_branch()
311
 
        >>> wt2 = d2.open_workingtree()
312
 
        >>> br1.missing_revisions(br2)
313
 
        []
314
 
        >>> wt2.commit("lala!", rev_id="REVISION-ID-1")
315
 
        >>> br1.missing_revisions(br2)
316
 
        [u'REVISION-ID-1']
317
 
        >>> br2.missing_revisions(br1)
318
 
        []
319
 
        >>> wt1.commit("lala!", rev_id="REVISION-ID-1")
320
 
        >>> br1.missing_revisions(br2)
321
 
        []
322
 
        >>> wt2.commit("lala!", rev_id="REVISION-ID-2A")
323
 
        >>> br1.missing_revisions(br2)
324
 
        [u'REVISION-ID-2A']
325
 
        >>> wt1.commit("lala!", rev_id="REVISION-ID-2B")
326
 
        >>> br1.missing_revisions(br2)
327
 
        Traceback (most recent call last):
328
 
        DivergedBranches: These branches have diverged.  Try merge.
329
303
        """
330
304
        self_history = self.revision_history()
331
305
        self_len = len(self_history)
1332
1306
            new_test.id = make_new_test_id()
1333
1307
            result.addTest(new_test)
1334
1308
        return result
1335
 
 
1336
 
 
1337
 
######################################################################
1338
 
# predicates
1339
 
 
1340
 
 
1341
 
@deprecated_function(zero_eight)
1342
 
def ScratchBranch(*args, **kwargs):
1343
 
    """See bzrlib.bzrdir.ScratchDir."""
1344
 
    d = ScratchDir(*args, **kwargs)
1345
 
    return d.open_branch()
1346
 
 
1347
 
 
1348
 
@deprecated_function(zero_eight)
1349
 
def is_control_file(*args, **kwargs):
1350
 
    """See bzrlib.workingtree.is_control_file."""
1351
 
    return bzrlib.workingtree.is_control_file(*args, **kwargs)