~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2007-08-21 16:27:21 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070821162721-feskghc4xcay1dk7
baz-import handles NULL_REVISION

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from bzrlib.commands import Command
31
31
from bzrlib.option import _global_option, Option
32
32
from bzrlib.merge import merge_inner
33
 
from bzrlib.revision import NULL_REVISION
 
33
from bzrlib.revision import NULL_REVISION, is_null
34
34
import bzrlib.ui
35
35
import bzrlib.ui.text
36
36
from bzrlib.workingtree import WorkingTree
293
293
        last_patch, last_encoding = get_last_revision(branch)
294
294
        assert encoding == last_encoding
295
295
        if last_patch is None:
296
 
            if branch.last_revision() != None:
 
296
            if not is_null(branch.last_revision()):
297
297
                raise NotPreviousImport(branch.base)
298
298
        elif version is None:
299
299
            version = last_patch.version
514
514
    'None'
515
515
    >>> str(arch_revision("Arch-1-utf-8:jrandom@example.com%test--test--0--patch-5")[1])
516
516
    'utf-8'
 
517
    >>> str(arch_revision('null:'))
 
518
    '(None, None)'
517
519
    """
518
 
    if revision_id is None:
 
520
    if is_null(revision_id):
519
521
        return None, None
520
522
    if revision_id[:7] not in ('Arch-1:', 'Arch-1-'):
521
523
        raise NotArchRevision(revision_id)