##// END OF EJS Templates
largefiles: fix a traceback in lfconvert if a largefile is missing (issue3519)...
Matt Harbison -
r17823:0fc1ce27 default
parent child Browse files
Show More
@@ -141,7 +141,17 b' def _addchangeset(ui, rsrc, rdst, ctx, r'
141
141
142 hash = fctx.data().strip()
142 hash = fctx.data().strip()
143 path = lfutil.findfile(rsrc, hash)
143 path = lfutil.findfile(rsrc, hash)
144 ### TODO: What if the file is not cached?
144
145 # If one file is missing, likely all files from this rev are
146 if path is None:
147 cachelfiles(ui, rsrc, ctx.node())
148 path = lfutil.findfile(rsrc, hash)
149
150 if path is None:
151 raise util.Abort(
152 _("missing largefile \'%s\' from revision %s")
153 % (f, node.hex(ctx.node())))
154
145 data = ''
155 data = ''
146 fd = None
156 fd = None
147 try:
157 try:
@@ -1,3 +1,5 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
1 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
4 > [extensions]
3 > largefiles =
5 > largefiles =
@@ -8,6 +10,7 b''
8 > minsize = 0.5
10 > minsize = 0.5
9 > patterns = **.other
11 > patterns = **.other
10 > **.dat
12 > **.dat
13 > usercache=${USERCACHE}
11 > EOF
14 > EOF
12
15
13 "lfconvert" works
16 "lfconvert" works
@@ -270,3 +273,14 b' round-trip: converting back to a normal '
270 pass
273 pass
271
274
272 $ cd ..
275 $ cd ..
276
277 Avoid a traceback if a largefile isn't available (issue3519)
278
279 $ hg clone -U largefiles-repo issue3519
280 $ rm "${USERCACHE}"/*
281 $ hg lfconvert --to-normal issue3519 normalized3519
282 initializing destination normalized3519
283 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
284 [255]
285
286
General Comments 0
You need to be logged in to leave comments. Login now