984 ) |
985 ) |
985 |
986 |
986 fm.plain(b'\n') |
987 fm.plain(b'\n') |
987 |
988 |
988 fm.end() |
989 fm.end() |
|
990 |
|
991 |
|
992 @command( |
|
993 b'debug-delta-find', |
|
994 cmdutil.debugrevlogopts + cmdutil.formatteropts, |
|
995 _(b'-c|-m|FILE REV'), |
|
996 optionalrepo=True, |
|
997 ) |
|
998 def debugdeltafind(ui, repo, arg_1, arg_2=None, **opts): |
|
999 """display the computation to get to a valid delta for storing REV |
|
1000 |
|
1001 This command will replay the process used to find the "best" delta to store |
|
1002 a revision and display information about all the steps used to get to that |
|
1003 result. |
|
1004 |
|
1005 The revision use the revision number of the target storage (not changelog |
|
1006 revision number). |
|
1007 |
|
1008 note: the process is initiated from a full text of the revision to store. |
|
1009 """ |
|
1010 opts = pycompat.byteskwargs(opts) |
|
1011 if arg_2 is None: |
|
1012 file_ = None |
|
1013 rev = arg_1 |
|
1014 else: |
|
1015 file_ = arg_1 |
|
1016 rev = arg_2 |
|
1017 |
|
1018 rev = int(rev) |
|
1019 |
|
1020 revlog = cmdutil.openrevlog(repo, b'debugdeltachain', file_, opts) |
|
1021 |
|
1022 deltacomputer = deltautil.deltacomputer( |
|
1023 revlog, |
|
1024 write_debug=ui.write, |
|
1025 debug_search=True, |
|
1026 ) |
|
1027 |
|
1028 node = revlog.node(rev) |
|
1029 p1r, p2r = revlog.parentrevs(rev) |
|
1030 p1 = revlog.node(p1r) |
|
1031 p2 = revlog.node(p2r) |
|
1032 btext = [revlog.revision(rev)] |
|
1033 textlen = len(btext[0]) |
|
1034 cachedelta = None |
|
1035 flags = revlog.flags(rev) |
|
1036 |
|
1037 revinfo = revlogutils.revisioninfo( |
|
1038 node, |
|
1039 p1, |
|
1040 p2, |
|
1041 btext, |
|
1042 textlen, |
|
1043 cachedelta, |
|
1044 flags, |
|
1045 ) |
|
1046 |
|
1047 fh = revlog._datafp() |
|
1048 deltacomputer.finddeltainfo(revinfo, fh, target_rev=rev) |
989 |
1049 |
990 |
1050 |
991 @command( |
1051 @command( |
992 b'debugdirstate|debugstate', |
1052 b'debugdirstate|debugstate', |
993 [ |
1053 [ |