##// END OF EJS Templates
util: implement a deterministic __repr__ on sortdict...
Gregory Szorc -
r29592:37cccad5 default
parent child Browse files
Show More
@@ -527,6 +527,10 b' class sortdict(dict):'
527 def insert(self, index, key, val):
527 def insert(self, index, key, val):
528 self._list.insert(index, key)
528 self._list.insert(index, key)
529 dict.__setitem__(self, key, val)
529 dict.__setitem__(self, key, val)
530 def __repr__(self):
531 if not self:
532 return '%s()' % self.__class__.__name__
533 return '%s(%r)' % (self.__class__.__name__, self.items())
530
534
531 class _lrucachenode(object):
535 class _lrucachenode(object):
532 """A node in a doubly linked list.
536 """A node in a doubly linked list.
@@ -52,7 +52,7 b' test bundle types'
52 1 changesets found
52 1 changesets found
53 HG20\x00\x00 (esc)
53 HG20\x00\x00 (esc)
54 Stream params: {}
54 Stream params: {}
55 changegroup -- "{'version': '02'}"
55 changegroup -- "sortdict([('version', '02')])"
56 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
56 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
57 none-v2
57 none-v2
58
58
@@ -60,8 +60,8 b' test bundle types'
60 searching for changes
60 searching for changes
61 1 changesets found
61 1 changesets found
62 HG20\x00\x00 (esc)
62 HG20\x00\x00 (esc)
63 Stream params: {'Compression': 'BZ'}
63 Stream params: sortdict([('Compression', 'BZ')])
64 changegroup -- "{'version': '02'}"
64 changegroup -- "sortdict([('version', '02')])"
65 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
65 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
66 bzip2-v2
66 bzip2-v2
67
67
@@ -69,8 +69,8 b' test bundle types'
69 searching for changes
69 searching for changes
70 1 changesets found
70 1 changesets found
71 HG20\x00\x00 (esc)
71 HG20\x00\x00 (esc)
72 Stream params: {'Compression': 'GZ'}
72 Stream params: sortdict([('Compression', 'GZ')])
73 changegroup -- "{'version': '02'}"
73 changegroup -- "sortdict([('version', '02')])"
74 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
74 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
75 gzip-v2
75 gzip-v2
76
76
@@ -79,7 +79,7 b' test bundle types'
79 1 changesets found
79 1 changesets found
80 HG20\x00\x00 (esc)
80 HG20\x00\x00 (esc)
81 Stream params: {}
81 Stream params: {}
82 changegroup -- "{'version': '02'}"
82 changegroup -- "sortdict([('version', '02')])"
83 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
83 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
84 none-v2
84 none-v2
85
85
@@ -87,8 +87,8 b' test bundle types'
87 searching for changes
87 searching for changes
88 1 changesets found
88 1 changesets found
89 HG20\x00\x00 (esc)
89 HG20\x00\x00 (esc)
90 Stream params: {'Compression': 'BZ'}
90 Stream params: sortdict([('Compression', 'BZ')])
91 changegroup -- "{'version': '02'}"
91 changegroup -- "sortdict([('version', '02')])"
92 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
92 c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
93 bzip2-v2
93 bzip2-v2
94
94
@@ -990,7 +990,7 b' Support for changegroup'
990
990
991 $ hg debugbundle ../rev.hg2
991 $ hg debugbundle ../rev.hg2
992 Stream params: {}
992 Stream params: {}
993 changegroup -- '{}'
993 changegroup -- 'sortdict()'
994 32af7686d403cf45b5d95f2d70cebea587ac806a
994 32af7686d403cf45b5d95f2d70cebea587ac806a
995 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
995 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
996 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
996 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -1118,8 +1118,8 b' Simple case where it just work: GZ'
1118 0360: db fb 6a 33 df c1 7d 99 cf ef d4 d5 6d da 77 7c |..j3..}.....m.w||
1118 0360: db fb 6a 33 df c1 7d 99 cf ef d4 d5 6d da 77 7c |..j3..}.....m.w||
1119 0370: 3b 19 fd af c5 3f f1 60 c3 17 |;....?.`..|
1119 0370: 3b 19 fd af c5 3f f1 60 c3 17 |;....?.`..|
1120 $ hg debugbundle ../rev.hg2.bz
1120 $ hg debugbundle ../rev.hg2.bz
1121 Stream params: {'Compression': 'GZ'}
1121 Stream params: sortdict([('Compression', 'GZ')])
1122 changegroup -- '{}'
1122 changegroup -- 'sortdict()'
1123 32af7686d403cf45b5d95f2d70cebea587ac806a
1123 32af7686d403cf45b5d95f2d70cebea587ac806a
1124 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
1124 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
1125 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
1125 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -1205,8 +1205,8 b' Simple case where it just work: BZ'
1205 0420: 8b 43 88 57 9c 01 f5 61 b5 e1 27 41 7e af 83 fe |.C.W...a..'A~...|
1205 0420: 8b 43 88 57 9c 01 f5 61 b5 e1 27 41 7e af 83 fe |.C.W...a..'A~...|
1206 0430: 2e e4 8a 70 a1 21 46 96 30 7a |...p.!F.0z|
1206 0430: 2e e4 8a 70 a1 21 46 96 30 7a |...p.!F.0z|
1207 $ hg debugbundle ../rev.hg2.bz
1207 $ hg debugbundle ../rev.hg2.bz
1208 Stream params: {'Compression': 'BZ'}
1208 Stream params: sortdict([('Compression', 'BZ')])
1209 changegroup -- '{}'
1209 changegroup -- 'sortdict()'
1210 32af7686d403cf45b5d95f2d70cebea587ac806a
1210 32af7686d403cf45b5d95f2d70cebea587ac806a
1211 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
1211 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
1212 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
1212 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -31,7 +31,7 b' Terse output:'
31
31
32 $ hg debugbundle bundle2.hg
32 $ hg debugbundle bundle2.hg
33 Stream params: {}
33 Stream params: {}
34 changegroup -- "{'version': '02'}"
34 changegroup -- "sortdict([('version', '02')])"
35 0e067c57feba1a5694ca4844f05588bb1bf82342
35 0e067c57feba1a5694ca4844f05588bb1bf82342
36 991a3460af53952d10ec8a295d3d2cc2e5fa9690
36 991a3460af53952d10ec8a295d3d2cc2e5fa9690
37
37
@@ -56,7 +56,7 b' Verbose output:'
56
56
57 $ hg debugbundle --all bundle2.hg
57 $ hg debugbundle --all bundle2.hg
58 Stream params: {}
58 Stream params: {}
59 changegroup -- "{'version': '02'}"
59 changegroup -- "sortdict([('version', '02')])"
60 format: id, p1, p2, cset, delta base, len(delta)
60 format: id, p1, p2, cset, delta base, len(delta)
61
61
62 changelog
62 changelog
@@ -154,8 +154,8 b' Test that strip bundle use bundle2'
154 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
154 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
155 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob)
155 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob)
156 $ hg debugbundle .hg/strip-backup/*
156 $ hg debugbundle .hg/strip-backup/*
157 Stream params: {'Compression': 'BZ'}
157 Stream params: sortdict([('Compression', 'BZ')])
158 changegroup -- "{'version': '02'}"
158 changegroup -- "sortdict([('version', '02')])"
159 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
159 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
160
160
161 $ cd ..
161 $ cd ..
@@ -170,7 +170,7 b' Get branch and merge:'
170 $ hg debuggetbundle repo bundle -t bundle2
170 $ hg debuggetbundle repo bundle -t bundle2
171 $ hg debugbundle bundle
171 $ hg debugbundle bundle
172 Stream params: {}
172 Stream params: {}
173 changegroup -- "{'version': '01'}"
173 changegroup -- "sortdict([('version', '01')])"
174 7704483d56b2a7b5db54dcee7c62378ac629b348
174 7704483d56b2a7b5db54dcee7c62378ac629b348
175 29a4d1f17bd3f0779ca0525bebb1cfb51067c738
175 29a4d1f17bd3f0779ca0525bebb1cfb51067c738
176 713346a995c363120712aed1aee7e04afd867638
176 713346a995c363120712aed1aee7e04afd867638
@@ -1044,8 +1044,8 b' with general delta'
1044 shelved as default
1044 shelved as default
1045 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1045 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1046 $ hg debugbundle .hg/shelved/*.hg
1046 $ hg debugbundle .hg/shelved/*.hg
1047 Stream params: {'Compression': 'BZ'}
1047 Stream params: sortdict([('Compression', 'BZ')])
1048 changegroup -- "{'version': '02'}"
1048 changegroup -- "sortdict([('version', '02')])"
1049 45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
1049 45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
1050 $ cd ..
1050 $ cd ..
1051
1051
@@ -210,8 +210,8 b''
210 summary: b
210 summary: b
211
211
212 $ hg debugbundle .hg/strip-backup/*
212 $ hg debugbundle .hg/strip-backup/*
213 Stream params: {'Compression': 'BZ'}
213 Stream params: sortdict([('Compression', 'BZ')])
214 changegroup -- "{'version': '02'}"
214 changegroup -- "sortdict([('version', '02')])"
215 264128213d290d868c54642d13aeaa3675551a78
215 264128213d290d868c54642d13aeaa3675551a78
216 $ hg pull .hg/strip-backup/*
216 $ hg pull .hg/strip-backup/*
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
General Comments 0
You need to be logged in to leave comments. Login now