149
149
Basically we keep looking up until we find the control directory or
150
150
run into the root. If there isn't one, raises NotBranchError.
151
If there is one and it is either an unrecognised format or an unsupported
152
format, UnknownFormatError or UnsupportedFormatError are raised.
151
153
If there is one, it is returned, along with the unused portion of url.
153
155
t = get_transport(url)
156
# this gets the normalised url back. I.e. '.' -> the full path.
157
160
format = BzrBranchFormat.find_format(t)
158
161
return format.open(t), t.relpath(url)
159
# TODO FIXME, distinguish between formats that cannot be
160
# identified, and a lack of format.
161
162
except NotBranchError, e:
162
163
mutter('not a branch in: %r %s', t.base, e)
163
164
new_t = t.clone('..')
525
526
def store_revision_signature(self, gpg_strategy, plaintext, revision_id):
526
527
raise NotImplementedError('store_revision_signature is abstract')
529
def fileid_involved_between_revs(self, from_revid, to_revid):
530
""" This function returns the file_id(s) involved in the
531
changes between the from_revid revision and the to_revid
534
raise NotImplementedError('fileid_involved_between_revs is abstract')
536
def fileid_involved(self, last_revid=None):
537
""" This function returns the file_id(s) involved in the
538
changes up to the revision last_revid
539
If no parametr is passed, then all file_id[s] present in the
540
repository are returned
542
raise NotImplementedError('fileid_involved is abstract')
544
def fileid_involved_by_set(self, changes):
545
""" This function returns the file_id(s) involved in the
546
changes present in the set 'changes'
548
raise NotImplementedError('fileid_involved_by_set is abstract')
550
def fileid_involved_between_revs(self, from_revid, to_revid):
551
""" This function returns the file_id(s) involved in the
552
changes between the from_revid revision and the to_revid
555
raise NotImplementedError('fileid_involved_between_revs is abstract')
557
def fileid_involved(self, last_revid=None):
558
""" This function returns the file_id(s) involved in the
559
changes up to the revision last_revid
560
If no parametr is passed, then all file_id[s] present in the
561
repository are returned
563
raise NotImplementedError('fileid_involved is abstract')
565
def fileid_involved_by_set(self, changes):
566
""" This function returns the file_id(s) involved in the
567
changes present in the set 'changes'
569
raise NotImplementedError('fileid_involved_by_set is abstract')
529
571
class BzrBranchFormat(object):
530
572
"""An encapsulation of the initialization and open routines for a format.
691
733
"""See BzrBranchFormat.get_format_string()."""
692
734
return BZR_BRANCH_FORMAT_5
694
def fileid_involved_between_revs(self, from_revid, to_revid):
695
""" This function returns the file_id(s) involved in the
696
changes between the from_revid revision and the to_revid
699
raise NotImplementedError('fileid_involved_between_revs is abstract')
701
def fileid_involved(self, last_revid=None):
702
""" This function returns the file_id(s) involved in the
703
changes up to the revision last_revid
704
If no parametr is passed, then all file_id[s] present in the
705
repository are returned
707
raise NotImplementedError('fileid_involved is abstract')
709
def fileid_involved_by_set(self, changes):
710
""" This function returns the file_id(s) involved in the
711
changes present in the set 'changes'
713
raise NotImplementedError('fileid_involved_by_set is abstract')
715
def fileid_involved_between_revs(self, from_revid, to_revid):
716
""" This function returns the file_id(s) involved in the
717
changes between the from_revid revision and the to_revid
720
raise NotImplementedError('fileid_involved_between_revs is abstract')
722
def fileid_involved(self, last_revid=None):
723
""" This function returns the file_id(s) involved in the
724
changes up to the revision last_revid
725
If no parametr is passed, then all file_id[s] present in the
726
repository are returned
728
raise NotImplementedError('fileid_involved is abstract')
730
def fileid_involved_by_set(self, changes):
731
""" This function returns the file_id(s) involved in the
732
changes present in the set 'changes'
734
raise NotImplementedError('fileid_involved_by_set is abstract')
737
737
class BzrBranchFormat6(BzrBranchFormat):
738
738
"""Bzr branch format 6.