Show More
@@ -47,6 +47,7 b' from . import (' | |||||
47 | context, |
|
47 | context, | |
48 | copies, |
|
48 | copies, | |
49 | dagparser, |
|
49 | dagparser, | |
|
50 | dirstateutils, | |||
50 | encoding, |
|
51 | encoding, | |
51 | error, |
|
52 | error, | |
52 | exchange, |
|
53 | exchange, | |
@@ -940,6 +941,12 b' def debugdeltachain(ui, repo, file_=None' | |||||
940 | (b'', b'datesort', None, _(b'sort by saved mtime')), |
|
941 | (b'', b'datesort', None, _(b'sort by saved mtime')), | |
941 | ( |
|
942 | ( | |
942 | b'', |
|
943 | b'', | |
|
944 | b'docket', | |||
|
945 | False, | |||
|
946 | _(b'display the docket (metadata file) instead'), | |||
|
947 | ), | |||
|
948 | ( | |||
|
949 | b'', | |||
943 | b'all', |
|
950 | b'all', | |
944 | False, |
|
951 | False, | |
945 | _(b'display dirstate-v2 tree nodes that would not exist in v1'), |
|
952 | _(b'display dirstate-v2 tree nodes that would not exist in v1'), | |
@@ -950,6 +957,33 b' def debugdeltachain(ui, repo, file_=None' | |||||
950 | def debugstate(ui, repo, **opts): |
|
957 | def debugstate(ui, repo, **opts): | |
951 | """show the contents of the current dirstate""" |
|
958 | """show the contents of the current dirstate""" | |
952 |
|
959 | |||
|
960 | if opts.get("docket"): | |||
|
961 | if not repo.dirstate._use_dirstate_v2: | |||
|
962 | raise error.Abort(_(b'dirstate v1 does not have a docket')) | |||
|
963 | ||||
|
964 | docket = repo.dirstate._map.docket | |||
|
965 | ( | |||
|
966 | start_offset, | |||
|
967 | root_nodes, | |||
|
968 | nodes_with_entry, | |||
|
969 | nodes_with_copy, | |||
|
970 | unused_bytes, | |||
|
971 | _unused, | |||
|
972 | ignore_pattern, | |||
|
973 | ) = dirstateutils.v2.TREE_METADATA.unpack(docket.tree_metadata) | |||
|
974 | ||||
|
975 | ui.write(_(b"size of dirstate data: %d\n") % docket.data_size) | |||
|
976 | ui.write(_(b"data file uuid: %s\n") % docket.uuid) | |||
|
977 | ui.write(_(b"start offset of root nodes: %d\n") % start_offset) | |||
|
978 | ui.write(_(b"number of root nodes: %d\n") % root_nodes) | |||
|
979 | ui.write(_(b"nodes with entries: %d\n") % nodes_with_entry) | |||
|
980 | ui.write(_(b"nodes with copies: %d\n") % nodes_with_copy) | |||
|
981 | ui.write(_(b"number of unused bytes: %d\n") % unused_bytes) | |||
|
982 | ui.write( | |||
|
983 | _(b"ignore pattern hash: %s\n") % binascii.hexlify(ignore_pattern) | |||
|
984 | ) | |||
|
985 | return | |||
|
986 | ||||
953 | nodates = not opts['dates'] |
|
987 | nodates = not opts['dates'] | |
954 | if opts.get('nodates') is not None: |
|
988 | if opts.get('nodates') is not None: | |
955 | nodates = True |
|
989 | nodates = True |
@@ -286,7 +286,7 b' Show all commands + options' | |||||
286 | debugdate: extended |
|
286 | debugdate: extended | |
287 | debugdeltachain: changelog, manifest, dir, template |
|
287 | debugdeltachain: changelog, manifest, dir, template | |
288 | debugdirstateignorepatternshash: |
|
288 | debugdirstateignorepatternshash: | |
289 | debugdirstate: nodates, dates, datesort, all |
|
289 | debugdirstate: nodates, dates, datesort, docket, all | |
290 | debugdiscovery: old, nonheads, rev, seed, local-as-revs, remote-as-revs, ssh, remotecmd, insecure, template |
|
290 | debugdiscovery: old, nonheads, rev, seed, local-as-revs, remote-as-revs, ssh, remotecmd, insecure, template | |
291 | debugdownload: output |
|
291 | debugdownload: output | |
292 | debugextensions: template |
|
292 | debugextensions: template |
@@ -418,14 +418,14 b' This is an optimization that is only rel' | |||||
418 | $ hg status > /dev/null |
|
418 | $ hg status > /dev/null | |
419 | $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 |
|
419 | $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 | |
420 | sha1=6e315b60f15fb5dfa02be00f3e2c8f923051f5ff |
|
420 | sha1=6e315b60f15fb5dfa02be00f3e2c8f923051f5ff | |
421 | $ hg debugdirstateignorepatternshash |
|
421 | $ hg debugstate --docket | grep ignore | |
422 | 6e315b60f15fb5dfa02be00f3e2c8f923051f5ff |
|
422 | ignore pattern hash: 6e315b60f15fb5dfa02be00f3e2c8f923051f5ff | |
423 |
|
423 | |||
424 | $ echo rel > .hg/testhgignorerel |
|
424 | $ echo rel > .hg/testhgignorerel | |
425 | $ hg status > /dev/null |
|
425 | $ hg status > /dev/null | |
426 | $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 |
|
426 | $ cat .hg/testhgignore .hg/testhgignorerel .hgignore dir2/.hgignore dir1/.hgignore dir1/.hgignoretwo | $TESTDIR/f --sha1 | |
427 | sha1=dea19cc7119213f24b6b582a4bae7b0cb063e34e |
|
427 | sha1=dea19cc7119213f24b6b582a4bae7b0cb063e34e | |
428 | $ hg debugdirstateignorepatternshash |
|
428 | $ hg debugstate --docket | grep ignore | |
429 | dea19cc7119213f24b6b582a4bae7b0cb063e34e |
|
429 | ignore pattern hash: dea19cc7119213f24b6b582a4bae7b0cb063e34e | |
430 |
|
430 | |||
431 | #endif |
|
431 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now