comparison hgext/largefiles/lfcommands.py @ 15340:0e58513cc59a stable

largefiles: rearrange how lfconvert detects non-local repos Mainly this is so we can test that code; it has the side benefit of not requiring network I/O to reject non-local repo URLs.
author Greg Ward <greg@gerg.ca>
date Sat, 22 Oct 2011 14:20:17 -0400
parents be1377d19018
children f26ed4ea46d8
comparison
equal deleted inserted replaced
15339:be1377d19018 15340:0e58513cc59a
41 if opts['to_normal']: 41 if opts['to_normal']:
42 tolfile = False 42 tolfile = False
43 else: 43 else:
44 tolfile = True 44 tolfile = True
45 size = lfutil.getminsize(ui, True, opts.get('size'), default=None) 45 size = lfutil.getminsize(ui, True, opts.get('size'), default=None)
46
47 if not hg.islocal(src):
48 raise util.Abort(_('%s is not a local Mercurial repo') % src)
49 if not hg.islocal(dest):
50 raise util.Abort(_('%s is not a local Mercurial repo') % dest)
51
46 rsrc = hg.repository(ui, src) 52 rsrc = hg.repository(ui, src)
47 if not rsrc.local():
48 raise util.Abort(_('%s is not a local Mercurial repo') % src)
49
50 ui.status(_('initializing destination %s\n') % dest) 53 ui.status(_('initializing destination %s\n') % dest)
51 rdst = hg.repository(ui, dest, create=True) 54 rdst = hg.repository(ui, dest, create=True)
52 if not rdst.local():
53 raise util.Abort(_('%s is not a local Mercurial repo') % dest)
54 55
55 success = False 56 success = False
56 try: 57 try:
57 # Lock destination to prevent modification while it is converted to. 58 # Lock destination to prevent modification while it is converted to.
58 # Don't need to lock src because we are just reading from its history 59 # Don't need to lock src because we are just reading from its history