Show More
@@ -60,7 +60,7 b' DIRSTATE_V2_DIRECTORY = 1 << 13' | |||||
60 |
|
60 | |||
61 |
|
61 | |||
62 | def parse_dirstate(map, copy_map, data, tree_metadata): |
|
62 | def parse_dirstate(map, copy_map, data, tree_metadata): | |
63 |
"""parse a full v2-dirstate from a binary data into diction |
|
63 | """parse a full v2-dirstate from a binary data into dictionaries: | |
64 |
|
64 | |||
65 | - map: a {path: entry} mapping that will be filled |
|
65 | - map: a {path: entry} mapping that will be filled | |
66 | - copy_map: a {path: copy-source} mapping that will be filled |
|
66 | - copy_map: a {path: copy-source} mapping that will be filled | |
@@ -191,7 +191,7 b' def pack_dirstate(map, copy_map):' | |||||
191 | # Algorithm explanation |
|
191 | # Algorithm explanation | |
192 |
|
192 | |||
193 | This explanation does not talk about the different counters for tracked |
|
193 | This explanation does not talk about the different counters for tracked | |
194 |
descend |
|
194 | descendants and storing the copies, but that work is pretty simple once this | |
195 | algorithm is in place. |
|
195 | algorithm is in place. | |
196 |
|
196 | |||
197 | ## Building a subtree |
|
197 | ## Building a subtree | |
@@ -274,7 +274,7 b' def pack_dirstate(map, copy_map):' | |||||
274 |
|
274 | |||
275 | sorted_map = sorted(map.items(), key=lambda x: x[0]) |
|
275 | sorted_map = sorted(map.items(), key=lambda x: x[0]) | |
276 |
|
276 | |||
277 |
# Use a stack to |
|
277 | # Use a stack to have to only remember the nodes we currently need | |
278 | # instead of building the entire tree in memory |
|
278 | # instead of building the entire tree in memory | |
279 | stack = [] |
|
279 | stack = [] | |
280 | current_node = Node(b"", None) |
|
280 | current_node = Node(b"", None) |
General Comments 0
You need to be logged in to leave comments.
Login now