~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Martin Pool
  • Date: 2006-06-20 07:55:43 UTC
  • mfrom: (1798 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1799.
  • Revision ID: mbp@sourcefrog.net-20060620075543-b10f6575d4a4fa32
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 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
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
import os
19
19
import errno
20
20
from tempfile import mkdtemp
 
21
import warnings
21
22
 
22
 
import bzrlib
23
23
from bzrlib.branch import Branch
24
24
from bzrlib.conflicts import ConflictList, Conflict
25
25
from bzrlib.delta import compare_trees
41
41
from bzrlib.osutils import rename, pathjoin, rmtree
42
42
from progress import DummyProgress, ProgressPhase
43
43
from bzrlib.revision import common_ancestor, is_ancestor, NULL_REVISION
44
 
from bzrlib.symbol_versioning import *
45
44
from bzrlib.textfile import check_text_lines
46
45
from bzrlib.trace import mutter, warning, note
47
46
from bzrlib.transform import (TreeTransform, resolve_conflicts, cook_conflicts,
48
47
                              FinalPaths, create_by_entry, unique_add)
49
48
from bzrlib.versionedfile import WeaveMerge
50
 
import bzrlib.ui
 
49
from bzrlib import ui
51
50
 
52
51
# TODO: Report back as changes are merged in
53
52
 
120
119
            changes = compare_trees(self.other_tree, other_basis_tree)
121
120
            if changes.has_changed():
122
121
                raise WorkingTreeNotRevision(self.this_tree)
123
 
            other_rev_id = other_basis
 
122
            other_rev_id = self.other_basis
124
123
            self.other_tree = other_basis_tree
125
124
 
126
125
    def file_revisions(self, file_id):
368
367
        self.tt = TreeTransform(working_tree, self.pb)
369
368
        try:
370
369
            self.pp.next_phase()
371
 
            child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
370
            child_pb = ui.ui_factory.nested_progress_bar()
372
371
            try:
373
372
                for num, file_id in enumerate(all_ids):
374
373
                    child_pb.update('Preparing file merge', num, len(all_ids))
379
378
                child_pb.finished()
380
379
                
381
380
            self.pp.next_phase()
382
 
            child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
381
            child_pb = ui.ui_factory.nested_progress_bar()
383
382
            try:
384
383
                fs_conflicts = resolve_conflicts(self.tt, child_pb)
385
384
            finally:
792
791
                                          pb=pb, pp=pp, reprocess=reprocess)
793
792
 
794
793
    def _get_revision_tree(self, tree):
795
 
        """Return a revision tree releated to this tree.
 
794
        """Return a revision tree related to this tree.
796
795
        If the tree is a WorkingTree, the basis will be returned.
797
796
        """
798
797
        if getattr(tree, 'get_weave', False) is False:
896
895
                     branch.get_revision_tree(base_revision))'
897
896
        """
898
897
    if this_tree is None:
899
 
        warn("bzrlib.merge.merge_inner requires a this_tree parameter as of "
 
898
        warnings.warn("bzrlib.merge.merge_inner requires a this_tree parameter as of "
900
899
             "bzrlib version 0.8.",
901
900
             DeprecationWarning,
902
901
             stacklevel=2)