/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2006-09-09 18:52:57 UTC
  • mfrom: (1996 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1997.
  • Revision ID: aaron.bentley@utoronto.ca-20060909185257-ce0ee03ee5125ff1
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
            revs.extend(revision)
240
240
        if revision_info_list is not None:
241
241
            for rev in revision_info_list:
242
 
                revs.append(RevisionSpec(rev))
 
242
                revs.append(RevisionSpec.from_string(rev))
243
243
        if len(revs) == 0:
244
244
            raise BzrCommandError('You must supply a revision identifier')
245
245
 
826
826
    def run(self, dir='.'):
827
827
        tree = WorkingTree.open_containing(dir)[0]
828
828
        tree.lock_write()
829
 
        existing_pending_merges = tree.pending_merges()
830
829
        try:
831
 
            last_rev = tree.last_revision() 
 
830
            existing_pending_merges = tree.pending_merges()
 
831
            last_rev = tree.last_revision()
832
832
            if last_rev == tree.branch.last_revision():
833
833
                # may be up to date, check master too.
834
834
                master = tree.branch.get_master_branch()
915
915
    def run(self, filename):
916
916
        tree, relpath = WorkingTree.open_containing(filename)
917
917
        i = tree.inventory.path2id(relpath)
918
 
        if i == None:
 
918
        if i is None:
919
919
            raise BzrError("%r is not a versioned file" % filename)
920
920
        else:
921
921
            self.outf.write(i + '\n')
936
936
        tree, relpath = WorkingTree.open_containing(filename)
937
937
        inv = tree.inventory
938
938
        fid = inv.path2id(relpath)
939
 
        if fid == None:
 
939
        if fid is None:
940
940
            raise BzrError("%r is not a versioned file" % filename)
941
941
        for fip in inv.get_idpath(fid):
942
942
            self.outf.write(fip + '\n')
1000
1000
            last_revision = wt.last_revision()
1001
1001
 
1002
1002
        revision_ids = b.repository.get_ancestry(last_revision)
1003
 
        assert revision_ids[0] == None
 
1003
        assert revision_ids[0] is None
1004
1004
        revision_ids.pop(0)
1005
1005
        for revision_id in revision_ids:
1006
1006
            self.outf.write(revision_id + '\n')
1379
1379
        if rev1 > rev2:
1380
1380
            (rev2, rev1) = (rev1, rev2)
1381
1381
 
1382
 
        if (log_format == None):
 
1382
        if (log_format is None):
1383
1383
            default = b.get_config().log_format()
1384
1384
            log_format = get_log_format(long=long, short=short, line=line, 
1385
1385
                                        default=default)
2252
2252
        tree, file_list = tree_files(file_list)
2253
2253
        tree.lock_write()
2254
2254
        try:
2255
 
            pending_merges = tree.pending_merges() 
2256
 
            if len(pending_merges) != 1:
 
2255
            parents = tree.get_parent_ids()
 
2256
            if len(parents) != 2:
2257
2257
                raise BzrCommandError("Sorry, remerge only works after normal"
2258
2258
                                      " merges.  Not cherrypicking or"
2259
2259
                                      " multi-merges.")
2260
2260
            repository = tree.branch.repository
2261
 
            base_revision = common_ancestor(tree.branch.last_revision(), 
2262
 
                                            pending_merges[0], repository)
 
2261
            base_revision = common_ancestor(parents[0],
 
2262
                                            parents[1], repository)
2263
2263
            base_tree = repository.revision_tree(base_revision)
2264
 
            other_tree = repository.revision_tree(pending_merges[0])
 
2264
            other_tree = repository.revision_tree(parents[1])
2265
2265
            interesting_ids = None
2266
2266
            new_conflicts = []
2267
2267
            conflicts = tree.conflicts()
2291
2291
                    pass
2292
2292
            conflicts = merge_inner(tree.branch, other_tree, base_tree,
2293
2293
                                    this_tree=tree,
2294
 
                                    interesting_ids=interesting_ids, 
2295
 
                                    other_rev_id=pending_merges[0], 
2296
 
                                    merge_type=merge_type, 
 
2294
                                    interesting_ids=interesting_ids,
 
2295
                                    other_rev_id=parents[1],
 
2296
                                    merge_type=merge_type,
2297
2297
                                    show_base=show_base,
2298
2298
                                    reprocess=reprocess)
2299
2299
        finally:
2429
2429
            remote_branch.lock_read()
2430
2430
            try:
2431
2431
                local_extra, remote_extra = find_unmerged(local_branch, remote_branch)
2432
 
                if (log_format == None):
 
2432
                if (log_format is None):
2433
2433
                    default = local_branch.get_config().log_format()
2434
2434
                    log_format = get_log_format(long=long, short=short, 
2435
2435
                                                line=line, default=default)
2483
2483
        import bzrlib.plugin
2484
2484
        from inspect import getdoc
2485
2485
        for name, plugin in bzrlib.plugin.all_plugins().items():
2486
 
            if hasattr(plugin, '__path__'):
 
2486
            if getattr(plugin, '__path__', None) is not None:
2487
2487
                print plugin.__path__[0]
2488
 
            elif hasattr(plugin, '__file__'):
 
2488
            elif getattr(plugin, '__file__', None) is not None:
2489
2489
                print plugin.__file__
2490
2490
            else:
2491
 
                print `plugin`
 
2491
                print repr(plugin)
2492
2492
                
2493
2493
            d = getdoc(plugin)
2494
2494
            if d: