Show More
@@ -697,23 +697,26 b' def debugsetparents(ui, repo, rev1, rev2' | |||
|
697 | 697 | finally: |
|
698 | 698 | del wlock |
|
699 | 699 | |
|
700 | def debugstate(ui, repo): | |
|
700 | def debugstate(ui, repo, nodates=None): | |
|
701 | 701 | """show the contents of the current dirstate""" |
|
702 | 702 | k = repo.dirstate._map.items() |
|
703 | 703 | k.sort() |
|
704 | timestr = "" | |
|
705 | showdate = not nodates | |
|
704 | 706 | for file_, ent in k: |
|
705 | if ent[3] == -1: | |
|
706 | # Pad or slice to locale representation | |
|
707 | locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(0))) | |
|
708 | timestr = 'unset' | |
|
709 | timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) | |
|
710 | else: | |
|
711 | timestr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(ent[3])) | |
|
707 | if showdate: | |
|
708 | if ent[3] == -1: | |
|
709 | # Pad or slice to locale representation | |
|
710 | locale_len = len(time.strftime("%Y-%m-%d %H:%M:%S ", time.localtime(0))) | |
|
711 | timestr = 'unset' | |
|
712 | timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) | |
|
713 | else: | |
|
714 | timestr = time.strftime("%Y-%m-%d %H:%M:%S ", time.localtime(ent[3])) | |
|
712 | 715 | if ent[1] & 020000: |
|
713 | 716 | mode = 'lnk' |
|
714 | 717 | else: |
|
715 | 718 | mode = '%3o' % (ent[1] & 0777) |
|
716 |
ui.write("%c %s %10d %s |
|
|
719 | ui.write("%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_)) | |
|
717 | 720 | for f in repo.dirstate.copies(): |
|
718 | 721 | ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) |
|
719 | 722 | |
@@ -2944,7 +2947,10 b' table = {' | |||
|
2944 | 2947 | (debugsetparents, |
|
2945 | 2948 | [], |
|
2946 | 2949 | _('hg debugsetparents REV1 [REV2]')), |
|
2947 | "debugstate": (debugstate, [], _('hg debugstate')), | |
|
2950 | "debugstate": | |
|
2951 | (debugstate, | |
|
2952 | [('', 'nodates', None, _('do not display the saved mtime'))], | |
|
2953 | _('hg debugstate [OPTS]')), | |
|
2948 | 2954 | "debugwalk": (debugwalk, walkopts, _('hg debugwalk [OPTION]... [FILE]...')), |
|
2949 | 2955 | "^diff": |
|
2950 | 2956 | (diff, |
@@ -37,7 +37,7 b' echo 2b > baz' | |||
|
37 | 37 | hg commit -m "branch b" -d "1000000 0" |
|
38 | 38 | |
|
39 | 39 | echo "we shouldn't have anything but n state here" |
|
40 | hg debugstate | cut -b 1-16,37- | |
|
40 | hg debugstate --nodates | |
|
41 | 41 | |
|
42 | 42 | echo merging |
|
43 | 43 | hg pull ../a |
@@ -48,7 +48,7 b' echo 2b > baz' | |||
|
48 | 48 | echo new > quux |
|
49 | 49 | |
|
50 | 50 | echo "we shouldn't have anything but foo in merge state here" |
|
51 |
hg debugstate |
|
|
51 | hg debugstate --nodates | grep "^m" | |
|
52 | 52 | |
|
53 | 53 | hg ci -m "merge" -d "1000000 0" |
|
54 | 54 |
@@ -12,13 +12,13 b' hg add baz' | |||
|
12 | 12 | hg rm bar |
|
13 | 13 | |
|
14 | 14 | echo '% state dump' |
|
15 |
hg debugstate |
|
|
15 | hg debugstate --nodates | sort | |
|
16 | 16 | echo '% status' |
|
17 | 17 | hg st -A |
|
18 | 18 | |
|
19 | 19 | hg debugrebuildstate |
|
20 | 20 | echo '% state dump' |
|
21 |
hg debugstate |
|
|
21 | hg debugstate --nodates | sort | |
|
22 | 22 | echo '% status' |
|
23 | 23 | hg st -A |
|
24 | 24 |
General Comments 0
You need to be logged in to leave comments.
Login now