~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-31 21:29:02 UTC
  • mfrom: (2104 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2110.
  • Revision ID: john@arbash-meinel.com-20061031212902-4b33920b90e9ce92
[merge] bzr.dev 2104

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
 
18
from cStringIO import StringIO
 
19
 
 
20
from bzrlib.lazy_import import lazy_import
 
21
lazy_import(globals(), """
18
22
from copy import deepcopy
19
 
from cStringIO import StringIO
20
23
from unittest import TestSuite
21
24
from warnings import warn
22
25
 
26
29
        cache_utf8,
27
30
        errors,
28
31
        lockdir,
 
32
        lockable_files,
29
33
        osutils,
30
 
        revision,
 
34
        revision as _mod_revision,
31
35
        transport,
32
36
        tree,
33
37
        ui,
34
38
        urlutils,
35
39
        )
36
 
from bzrlib.config import TreeConfig
 
40
from bzrlib.config import BranchConfig, TreeConfig
 
41
from bzrlib.lockable_files import LockableFiles, TransportLock
 
42
""")
 
43
 
37
44
from bzrlib.decorators import needs_read_lock, needs_write_lock
38
 
import bzrlib.errors as errors
39
 
from bzrlib.errors import (BzrError, BzrCheckError, DivergedBranches, 
40
 
                           HistoryMissing, InvalidRevisionId, 
41
 
                           InvalidRevisionNumber, LockError, NoSuchFile, 
 
45
from bzrlib.errors import (BzrError, BzrCheckError, DivergedBranches,
 
46
                           HistoryMissing, InvalidRevisionId,
 
47
                           InvalidRevisionNumber, LockError, NoSuchFile,
42
48
                           NoSuchRevision, NoWorkingTree, NotVersionedError,
43
 
                           NotBranchError, UninitializableFormat, 
44
 
                           UnlistableStore, UnlistableBranch, 
 
49
                           NotBranchError, UninitializableFormat,
 
50
                           UnlistableStore, UnlistableBranch,
45
51
                           )
46
 
from bzrlib.lockable_files import LockableFiles, TransportLock
47
52
from bzrlib.symbol_versioning import (deprecated_function,
48
53
                                      deprecated_method,
49
54
                                      DEPRECATED_PARAMETER,
148
153
        pass
149
154
 
150
155
    def get_config(self):
151
 
        return bzrlib.config.BranchConfig(self)
 
156
        return BranchConfig(self)
152
157
 
153
158
    def _get_nick(self):
154
159
        return self.get_config().get_nickname()
222
227
                    last_revision = from_history[-1]
223
228
                else:
224
229
                    # no history in the source branch
225
 
                    last_revision = revision.NULL_REVISION
 
230
                    last_revision = _mod_revision.NULL_REVISION
226
231
            return self.repository.fetch(from_branch.repository,
227
232
                                         revision_id=last_revision,
228
233
                                         pb=nested_pb)
729
734
        utf8_files = [('revision-history', ''),
730
735
                      ('branch-name', ''),
731
736
                      ]
732
 
        control_files = LockableFiles(branch_transport, 'branch-lock',
733
 
                                      TransportLock)
 
737
        control_files = lockable_files.LockableFiles(branch_transport,
 
738
                             'branch-lock', lockable_files.TransportLock)
734
739
        control_files.create_lock()
735
740
        control_files.lock_write()
736
741
        try:
790
795
        utf8_files = [('revision-history', ''),
791
796
                      ('branch-name', ''),
792
797
                      ]
793
 
        control_files = LockableFiles(branch_transport, 'lock', lockdir.LockDir)
 
798
        control_files = lockable_files.LockableFiles(branch_transport, 'lock',
 
799
                                                     lockdir.LockDir)
794
800
        control_files.create_lock()
795
801
        control_files.lock_write()
796
802
        control_files.put_utf8('format', self.get_format_string())
815
821
            format = BranchFormat.find_format(a_bzrdir)
816
822
            assert format.__class__ == self.__class__
817
823
        transport = a_bzrdir.get_branch_transport(None)
818
 
        control_files = LockableFiles(transport, 'lock', lockdir.LockDir)
 
824
        control_files = lockable_files.LockableFiles(transport, 'lock',
 
825
                                                     lockdir.LockDir)
819
826
        return BzrBranch5(_format=self,
820
827
                          _control_files=control_files,
821
828
                          a_bzrdir=a_bzrdir,
1129
1136
        # make a new revision history from the graph
1130
1137
        current_rev_id = revision_id
1131
1138
        new_history = []
1132
 
        while current_rev_id not in (None, revision.NULL_REVISION):
 
1139
        while current_rev_id not in (None, _mod_revision.NULL_REVISION):
1133
1140
            new_history.append(current_rev_id)
1134
1141
            current_rev_id_parents = stop_graph[current_rev_id]
1135
1142
            try: