##// END OF EJS Templates
largefiles: eliminate naked exceptions
Matt Mackall -
r15171:547da611 default
parent child Browse files
Show More
@@ -65,6 +65,7 b' def lfconvert(ui, src, dest, *pats, **op'
65 ui.traceback()
65 ui.traceback()
66 raise util.Abort(_('%s is not a repo') % dest)
66 raise util.Abort(_('%s is not a repo') % dest)
67
67
68 success = False
68 try:
69 try:
69 # Lock destination to prevent modification while it is converted to.
70 # Lock destination to prevent modification while it is converted to.
70 # Don't need to lock src because we are just reading from its history
71 # Don't need to lock src because we are just reading from its history
@@ -106,7 +107,7 b' def lfconvert(ui, src, dest, *pats, **op'
106 os.unlink(rdst.wjoin(f))
107 os.unlink(rdst.wjoin(f))
107 try:
108 try:
108 os.removedirs(os.path.dirname(rdst.wjoin(f)))
109 os.removedirs(os.path.dirname(rdst.wjoin(f)))
109 except:
110 except OSError:
110 pass
111 pass
111
112
112 else:
113 else:
@@ -116,11 +117,11 b' def lfconvert(ui, src, dest, *pats, **op'
116 _addchangeset(ui, rsrc, rdst, ctx, revmap)
117 _addchangeset(ui, rsrc, rdst, ctx, revmap)
117
118
118 ui.progress(_('converting revisions'), None)
119 ui.progress(_('converting revisions'), None)
119 except:
120 success = True
120 # we failed, remove the new directory
121 shutil.rmtree(rdst.root)
122 raise
123 finally:
121 finally:
122 if not success:
123 # we failed, remove the new directory
124 shutil.rmtree(rdst.root)
124 dst_lock.release()
125 dst_lock.release()
125
126
126 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
127 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
@@ -103,12 +103,7 b' def findoutgoing(repo, remote, force):'
103
103
104 if os.name == 'nt':
104 if os.name == 'nt':
105 from mercurial import win32
105 from mercurial import win32
106 try:
106 linkfn = win32.oslink
107 linkfn = win32.oslink
108 except:
109 linkfn = win32.os_link
110 else:
111 linkfn = os.link
112
107
113 def link(src, dest):
108 def link(src, dest):
114 try:
109 try:
@@ -114,7 +114,7 b' def reposetup(ui, repo):'
114 return file in ctx.manifest()
114 return file in ctx.manifest()
115 ctx[file]
115 ctx[file]
116 return True
116 return True
117 except:
117 except KeyError:
118 return False
118 return False
119
119
120 # create a copy of match that matches standins instead of
120 # create a copy of match that matches standins instead of
General Comments 0
You need to be logged in to leave comments. Login now