Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/convert/hg.py @ 5354:4fbd27bf04b1
convert: fail properly if we can't read a source hg repository
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 02 Oct 2007 13:48:52 -0700 |
parents | cc34be74eeec |
children | b98c377b3c16 |
comparison
equal
deleted
inserted
replaced
5353:c6adf2be6069 | 5354:4fbd27bf04b1 |
---|---|
154 return hex(self.repo.changelog.tip()) | 154 return hex(self.repo.changelog.tip()) |
155 | 155 |
156 class mercurial_source(converter_source): | 156 class mercurial_source(converter_source): |
157 def __init__(self, ui, path, rev=None): | 157 def __init__(self, ui, path, rev=None): |
158 converter_source.__init__(self, ui, path, rev) | 158 converter_source.__init__(self, ui, path, rev) |
159 self.repo = hg.repository(self.ui, path) | 159 try: |
160 self.repo = hg.repository(self.ui, path) | |
161 except: | |
162 raise NoRepo("could not open hg repo %s as source" % path) | |
160 self.lastrev = None | 163 self.lastrev = None |
161 self.lastctx = None | 164 self.lastctx = None |
162 | 165 |
163 def changectx(self, rev): | 166 def changectx(self, rev): |
164 if self.lastrev != rev: | 167 if self.lastrev != rev: |