~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz_import.py

  • Committer: Aaron Bentley
  • Date: 2007-06-12 22:09:44 UTC
  • mfrom: (540.1.2 bzrtools-0.17)
  • Revision ID: aaron.bentley@utoronto.ca-20070612220944-5zw4hlzp1ctq6mkl
Merge fixes from 0.17

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, is_null
 
33
from bzrlib.revision import NULL_REVISION
34
34
import bzrlib.ui
35
35
import bzrlib.ui.text
36
36
from bzrlib.workingtree import WorkingTree
42
42
    from pybaz.backends.baz import null_cmd
43
43
except ImportError:
44
44
    raise NoPyBaz
45
 
from baz_helper import iter_new_merges, direct_merges
 
45
from fai import iter_new_merges, direct_merges
46
46
import tempfile
47
47
import os
48
48
import os.path
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 not is_null(branch.last_revision()):
 
296
            if branch.last_revision() != None:
297
297
                raise NotPreviousImport(branch.base)
298
298
        elif version is None:
299
299
            version = last_patch.version
449
449
            if wt is not None:
450
450
                wt.set_last_revision(wt.branch.last_revision())
451
451
                wt.set_root_id(BAZ_IMPORT_ROOT)
452
 
                wt.revert()
 
452
                wt.revert([])
453
453
 
454
454
        finally:
455
455
 
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)'
519
517
    """
520
 
    if is_null(revision_id):
 
518
    if revision_id is None:
521
519
        return None, None
522
520
    if revision_id[:7] not in ('Arch-1:', 'Arch-1-'):
523
521
        raise NotArchRevision(revision_id)
609
607
        else:
610
608
            target_branch = create_branch(output_dir)
611
609
 
612
 
    for i, revision in enumerate(ancestors):
 
610
    for i in range(len(ancestors)):
 
611
        revision = ancestors[i]
613
612
        rev_id = revision_id(revision, encoding)
614
613
        direct_merges = []
615
614
        if verbose:
622
621
            yield Progress("revisions", i, len(ancestors))
623
622
 
624
623
        if target_branch.repository.has_revision(rev_id):
625
 
            target_branch.set_last_revision_info(i+1, rev_id)
 
624
            target_branch.append_revision(rev_id)
626
625
            continue
627
626
        if revdir is None:
628
627
            revdir = os.path.join(tempdir, "rd")