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

  • Committer: Robert Collins
  • Date: 2005-08-24 08:34:10 UTC
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050824083410-98aa4eeb52653394
import and use TestUtil to do regex based partial test runs

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
import bzrlib.errors
18
19
 
19
20
 
20
21
class RevisionReference(object):
113
114
def unpack_revision(elt):
114
115
    """Convert XML element into Revision object."""
115
116
    # <changeset> is deprecated...
116
 
    from bzrlib.errors import BzrError
117
 
    
118
117
    if elt.tag not in ('revision', 'changeset'):
119
 
        raise BzrError("unexpected tag in revision file: %r" % elt)
 
118
        raise bzrlib.errors.BzrError("unexpected tag in revision file: %r" % elt)
120
119
 
121
120
    rev = Revision(committer = elt.get('committer'),
122
121
                   timestamp = float(elt.get('timestamp')),
177
176
    behaves like Branch's.
178
177
    """
179
178
 
180
 
    from bzrlib.branch import NoSuchRevision
181
179
    ancestors = (revision_id,)
182
180
    while len(ancestors) > 0:
183
181
        new_ancestors = []
186
184
                return True
187
185
            try:
188
186
                revision = revision_source.get_revision(ancestor)
189
 
            except NoSuchRevision, e:
 
187
            except bzrlib.errors.NoSuchRevision, e:
190
188
                if e.revision == revision_id:
191
 
                    raise e
 
189
                    raise 
192
190
                else:
193
191
                    continue
194
192
            new_ancestors.extend([p.revision_id for p in revision.parents])
202
200
        self._revision_sources = args
203
201
 
204
202
    def get_revision(self, revision_id):
205
 
        from bzrlib.branch import NoSuchRevision
206
203
        for source in self._revision_sources:
207
204
            try:
208
205
                return source.get_revision(revision_id)
209
 
            except NoSuchRevision, e:
 
206
            except bzrlib.errors.NoSuchRevision, e:
210
207
                pass
211
208
        raise e