/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/branch.py

  • Committer: Robert Collins
  • Date: 2006-06-09 09:04:53 UTC
  • mfrom: (1755.2.1 add)
  • mto: (1755.1.2 integration)
  • mto: This revision was merged to the branch mainline in revision 1757.
  • Revision ID: robertc@robertcollins.net-20060609090453-10e94172dc5f670b
MergeĀ currentĀ head.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
                            safe_unicode,
48
48
                            rmtree,
49
49
                            )
50
 
from bzrlib.textui import show_status
51
 
from bzrlib.trace import mutter, note
52
 
from bzrlib.tree import EmptyTree, RevisionTree
53
50
from bzrlib.repository import Repository
54
51
from bzrlib.revision import (
55
52
                             is_ancestor,
58
55
                             )
59
56
from bzrlib.store import copy_all
60
57
from bzrlib.symbol_versioning import *
 
58
from bzrlib.textui import show_status
 
59
from bzrlib.trace import mutter, note
61
60
import bzrlib.transactions as transactions
62
61
from bzrlib.transport import Transport, get_transport
63
62
from bzrlib.tree import EmptyTree, RevisionTree
64
63
import bzrlib.ui
 
64
import bzrlib.urlutils as urlutils
65
65
import bzrlib.xml5
66
66
 
67
67
 
249
249
        branch.
250
250
        """
251
251
        return None
 
252
    
 
253
    def get_commit_builder(self, parents, config=None, timestamp=None, 
 
254
                           timezone=None, committer=None, revprops=None, 
 
255
                           revision_id=None):
 
256
        """Obtain a CommitBuilder for this branch.
 
257
        
 
258
        :param parents: Revision ids of the parents of the new revision.
 
259
        :param config: Optional configuration to use.
 
260
        :param timestamp: Optional timestamp recorded for commit.
 
261
        :param timezone: Optional timezone for timestamp.
 
262
        :param committer: Optional committer to set for commit.
 
263
        :param revprops: Optional dictionary of revision properties.
 
264
        :param revision_id: Optional revision id.
 
265
        """
 
266
 
 
267
        if config is None:
 
268
            config = bzrlib.config.BranchConfig(self)
 
269
        
 
270
        return self.repository.get_commit_builder(self, parents, config, 
 
271
            timestamp, timezone, committer, revprops, revision_id)
252
272
 
253
273
    def get_master_branch(self):
254
274
        """Return the branch we are bound to.
1133
1153
        """See Branch.get_parent."""
1134
1154
        import errno
1135
1155
        _locs = ['parent', 'pull', 'x-pull']
 
1156
        assert self.base[-1] == '/'
1136
1157
        for l in _locs:
1137
1158
            try:
1138
 
                return self.control_files.get_utf8(l).read().strip('\n')
 
1159
                return urlutils.join(self.base[:-1], 
 
1160
                            self.control_files.get(l).read().strip('\n'))
1139
1161
            except NoSuchFile:
1140
1162
                pass
1141
1163
        return None
1162
1184
        if url is None:
1163
1185
            self.control_files._transport.delete('parent')
1164
1186
        else:
1165
 
            self.control_files.put_utf8('parent', url + '\n')
 
1187
            if isinstance(url, unicode):
 
1188
                try: 
 
1189
                    url = url.encode('ascii')
 
1190
                except UnicodeEncodeError:
 
1191
                    raise bzrlib.errors.InvalidURL(url,
 
1192
                        "Urls must be 7-bit ascii, "
 
1193
                        "use bzrlib.urlutils.escape")
 
1194
                    
 
1195
            url = urlutils.relative_url(self.base, url)
 
1196
            self.control_files.put('parent', url + '\n')
1166
1197
 
1167
1198
    def tree_config(self):
1168
1199
        return TreeConfig(self)