/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: ghigo
  • Date: 2006-10-22 16:43:28 UTC
  • mfrom: (2091 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2126.
  • Revision ID: ghigo@venice-20061022164328-da86f3a7676b06bd
Update to bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
849
849
 
850
850
    def run(self, dir='.'):
851
851
        tree = WorkingTree.open_containing(dir)[0]
852
 
        tree.lock_write()
 
852
        master = tree.branch.get_master_branch()
 
853
        if master is not None:
 
854
            tree.lock_write()
 
855
        else:
 
856
            tree.lock_tree_write()
853
857
        try:
854
858
            existing_pending_merges = tree.get_parent_ids()[1:]
855
859
            last_rev = tree.last_revision()
2328
2332
                    for name, ie in tree.inventory.iter_entries(file_id):
2329
2333
                        interesting_ids.add(ie.file_id)
2330
2334
                new_conflicts = conflicts.select_conflicts(tree, file_list)[0]
 
2335
            else:
 
2336
                # Remerge only supports resolving contents conflicts
 
2337
                allowed_conflicts = ('text conflict', 'contents conflict')
 
2338
                restore_files = [c.path for c in conflicts
 
2339
                                 if c.typestring in allowed_conflicts]
2331
2340
            _mod_merge.transform_tree(tree, tree.basis_tree(), interesting_ids)
2332
2341
            tree.set_conflicts(ConflictList(new_conflicts))
2333
 
            if file_list is None:
2334
 
                restore_files = list(tree.iter_conflicts())
2335
 
            else:
 
2342
            if file_list is not None:
2336
2343
                restore_files = file_list
2337
2344
            for filename in restore_files:
2338
2345
                try: