##// END OF EJS Templates
store: use StoreEntry API instead of parsing filename when fixing issue6528...
marmoute -
r51379:85c5b4b5 default
parent child Browse files
Show More
@@ -828,8 +828,8 b' def repair_issue6528('
828 entry
828 entry
829 for entry in repo.store.datafiles()
829 for entry in repo.store.datafiles()
830 if (
830 if (
831 entry.unencoded_path.endswith(b'.i')
831 entry.is_revlog
832 and entry.is_revlog
832 and entry.is_revlog_main
833 and entry.revlog_type == store.FILEFLAGS_FILELOG
833 and entry.revlog_type == store.FILEFLAGS_FILELOG
834 )
834 )
835 )
835 )
@@ -842,10 +842,9 b' def repair_issue6528('
842 found_nothing = True
842 found_nothing = True
843
843
844 for entry in files:
844 for entry in files:
845 path = entry.unencoded_path
846 progress.increment()
845 progress.increment()
847 filename = _get_filename_from_filelog_index(path)
846 filename = entry.target_id
848 fl = _filelog_from_filename(repo, filename)
847 fl = _filelog_from_filename(repo, entry.target_id)
849
848
850 # Set of filerevs (or hex filenodes if `to_report`) that need fixing
849 # Set of filerevs (or hex filenodes if `to_report`) that need fixing
851 to_fix = set()
850 to_fix = set()
@@ -861,8 +860,8 b' def repair_issue6528('
861 node = binascii.hexlify(fl.node(filerev))
860 node = binascii.hexlify(fl.node(filerev))
862 raise error.Abort(msg % (filename, node))
861 raise error.Abort(msg % (filename, node))
863 if affected:
862 if affected:
864 msg = b"found affected revision %d for filelog '%s'\n"
863 msg = b"found affected revision %d for file '%s'\n"
865 ui.warn(msg % (filerev, path))
864 ui.warn(msg % (filerev, filename))
866 found_nothing = False
865 found_nothing = False
867 if not dry_run:
866 if not dry_run:
868 if to_report:
867 if to_report:
@@ -201,9 +201,9 b' deltas where possible.)'
201
201
202 Dry-run the fix
202 Dry-run the fix
203 $ hg debug-repair-issue6528 --dry-run
203 $ hg debug-repair-issue6528 --dry-run
204 found affected revision 1 for filelog 'data/D.txt.i'
204 found affected revision 1 for file 'D.txt'
205 found affected revision 1 for filelog 'data/b.txt.i'
205 found affected revision 1 for file 'b.txt'
206 found affected revision 3 for filelog 'data/b.txt.i'
206 found affected revision 3 for file 'b.txt'
207 $ hg st
207 $ hg st
208 M D.txt
208 M D.txt
209 M b.txt
209 M b.txt
@@ -220,9 +220,9 b' Dry-run the fix'
220
220
221 Test the --paranoid option
221 Test the --paranoid option
222 $ hg debug-repair-issue6528 --dry-run --paranoid
222 $ hg debug-repair-issue6528 --dry-run --paranoid
223 found affected revision 1 for filelog 'data/D.txt.i'
223 found affected revision 1 for file 'D.txt'
224 found affected revision 1 for filelog 'data/b.txt.i'
224 found affected revision 1 for file 'b.txt'
225 found affected revision 3 for filelog 'data/b.txt.i'
225 found affected revision 3 for file 'b.txt'
226 $ hg st
226 $ hg st
227 M D.txt
227 M D.txt
228 M b.txt
228 M b.txt
@@ -239,10 +239,10 b' Test the --paranoid option'
239
239
240 Run the fix
240 Run the fix
241 $ hg debug-repair-issue6528
241 $ hg debug-repair-issue6528
242 found affected revision 1 for filelog 'data/D.txt.i'
242 found affected revision 1 for file 'D.txt'
243 repaired revision 1 of 'filelog data/D.txt.i'
243 repaired revision 1 of 'filelog data/D.txt.i'
244 found affected revision 1 for filelog 'data/b.txt.i'
244 found affected revision 1 for file 'b.txt'
245 found affected revision 3 for filelog 'data/b.txt.i'
245 found affected revision 3 for file 'b.txt'
246 repaired revision 1 of 'filelog data/b.txt.i'
246 repaired revision 1 of 'filelog data/b.txt.i'
247 repaired revision 3 of 'filelog data/b.txt.i'
247 repaired revision 3 of 'filelog data/b.txt.i'
248
248
@@ -281,9 +281,9 b' Try the using the report options'
281 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
281 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
282
282
283 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
283 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
284 found affected revision 1 for filelog 'data/D.txt.i'
284 found affected revision 1 for file 'D.txt'
285 found affected revision 1 for filelog 'data/b.txt.i'
285 found affected revision 1 for file 'b.txt'
286 found affected revision 3 for filelog 'data/b.txt.i'
286 found affected revision 3 for file 'b.txt'
287 $ cat $TESTTMP/report.txt
287 $ cat $TESTTMP/report.txt
288 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
288 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
289 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
289 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
@@ -392,10 +392,10 b' Status is correct, but the problem is st'
392
392
393 Run the fix on the non-inline revlog
393 Run the fix on the non-inline revlog
394 $ hg debug-repair-issue6528
394 $ hg debug-repair-issue6528
395 found affected revision 1 for filelog 'data/D.txt.i'
395 found affected revision 1 for file 'D.txt'
396 repaired revision 1 of 'filelog data/D.txt.i'
396 repaired revision 1 of 'filelog data/D.txt.i'
397 found affected revision 1 for filelog 'data/b.txt.i'
397 found affected revision 1 for file 'b.txt'
398 found affected revision 3 for filelog 'data/b.txt.i'
398 found affected revision 3 for file 'b.txt'
399 repaired revision 1 of 'filelog data/b.txt.i'
399 repaired revision 1 of 'filelog data/b.txt.i'
400 repaired revision 3 of 'filelog data/b.txt.i'
400 repaired revision 3 of 'filelog data/b.txt.i'
401
401
@@ -556,9 +556,9 b' That we do see the symptoms of the bug'
556 And that the repair command find issue to fix.
556 And that the repair command find issue to fix.
557
557
558 $ hg debug-repair-issue6528 --dry-run
558 $ hg debug-repair-issue6528 --dry-run
559 found affected revision 1 for filelog 'data/D.txt.i'
559 found affected revision 1 for file 'D.txt'
560 found affected revision 1 for filelog 'data/b.txt.i'
560 found affected revision 1 for file 'b.txt'
561 found affected revision 3 for filelog 'data/b.txt.i'
561 found affected revision 3 for file 'b.txt'
562
562
563 $ cd ..
563 $ cd ..
564
564
@@ -604,8 +604,8 b' That we do see the symptoms of the bug'
604 And that the repair command find issue to fix.
604 And that the repair command find issue to fix.
605
605
606 $ hg debug-repair-issue6528 --dry-run
606 $ hg debug-repair-issue6528 --dry-run
607 found affected revision 1 for filelog 'data/D.txt.i'
607 found affected revision 1 for file 'D.txt'
608 found affected revision 1 for filelog 'data/b.txt.i'
608 found affected revision 1 for file 'b.txt'
609 found affected revision 3 for filelog 'data/b.txt.i'
609 found affected revision 3 for file 'b.txt'
610
610
611 $ cd ..
611 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now