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