Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/lfcommands.py @ 15339:be1377d19018 stable
largefiles: test lfconvert error handling; remove redundant code
author | Greg Ward <greg@gerg.ca> |
---|---|
date | Sat, 22 Oct 2011 14:17:19 -0400 |
parents | 0db47b8d025f |
children | 0e58513cc59a |
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py Sat Oct 22 13:48:56 2011 -0400 +++ b/hgext/largefiles/lfcommands.py Sat Oct 22 14:17:19 2011 -0400 @@ -43,26 +43,14 @@ else: tolfile = True size = lfutil.getminsize(ui, True, opts.get('size'), default=None) - try: - rsrc = hg.repository(ui, src) - if not rsrc.local(): - raise util.Abort(_('%s is not a local Mercurial repo') % src) - except error.RepoError, err: - ui.traceback() - raise util.Abort(err.args[0]) - if os.path.exists(dest): - if not os.path.isdir(dest): - raise util.Abort(_('destination %s already exists') % dest) - elif os.listdir(dest): - raise util.Abort(_('destination %s is not empty') % dest) - try: - ui.status(_('initializing destination %s\n') % dest) - rdst = hg.repository(ui, dest, create=True) - if not rdst.local(): - raise util.Abort(_('%s is not a local Mercurial repo') % dest) - except error.RepoError: - ui.traceback() - raise util.Abort(_('%s is not a repo') % dest) + rsrc = hg.repository(ui, src) + if not rsrc.local(): + raise util.Abort(_('%s is not a local Mercurial repo') % src) + + ui.status(_('initializing destination %s\n') % dest) + rdst = hg.repository(ui, dest, create=True) + if not rdst.local(): + raise util.Abort(_('%s is not a local Mercurial repo') % dest) success = False try: