Show More
@@ -707,10 +707,11 b' class localrepository(object):' | |||||
707 | # be one tagtype for all such "virtual" tags? Or is the status |
|
707 | # be one tagtype for all such "virtual" tags? Or is the status | |
708 | # quo fine? |
|
708 | # quo fine? | |
709 |
|
709 | |||
710 | alltags = {} # map tag name to (node, hist) |
|
|||
711 | tagtypes = {} |
|
|||
712 |
|
710 | |||
713 |
tagsmod.findglobaltags(self.ui, self |
|
711 | globaldata = tagsmod.findglobaltags(self.ui, self) | |
|
712 | alltags = globaldata[0] # map tag name to (node, hist) | |||
|
713 | tagtypes = globaldata[1] # map tag name to tag type | |||
|
714 | ||||
714 | tagsmod.readlocaltags(self.ui, self, alltags, tagtypes) |
|
715 | tagsmod.readlocaltags(self.ui, self, alltags, tagtypes) | |
715 |
|
716 | |||
716 | # Build the return dicts. Have to re-encode tag names because |
|
717 | # Build the return dicts. Have to re-encode tag names because |
@@ -78,23 +78,18 b' from . import (' | |||||
78 | # The most recent changeset (in terms of revlog ordering for the head |
|
78 | # The most recent changeset (in terms of revlog ordering for the head | |
79 | # setting it) for each tag is last. |
|
79 | # setting it) for each tag is last. | |
80 |
|
80 | |||
81 |
def findglobaltags(ui, repo |
|
81 | def findglobaltags(ui, repo): | |
82 |
'''Find global tags in a repo |
|
82 | '''Find global tags in a repo: return (alltags, tagtypes) | |
83 |
|
83 | |||
84 | "alltags" maps tag name to (node, hist) 2-tuples. |
|
84 | "alltags" maps tag name to (node, hist) 2-tuples. | |
85 |
|
85 | |||
86 | "tagtypes" maps tag name to tag type. Global tags always have the |
|
86 | "tagtypes" maps tag name to tag type. Global tags always have the | |
87 | "global" tag type. |
|
87 | "global" tag type. | |
88 |
|
88 | |||
89 | The "alltags" and "tagtypes" dicts are updated in place. Empty dicts |
|
|||
90 | should be passed in. |
|
|||
91 |
|
||||
92 | The tags cache is read and updated as a side-effect of calling. |
|
89 | The tags cache is read and updated as a side-effect of calling. | |
93 | ''' |
|
90 | ''' | |
94 | # This is so we can be lazy and assume alltags contains only global |
|
91 | alltags = {} | |
95 | # tags when we pass it to _writetagcache(). |
|
92 | tagtypes = {} | |
96 | assert len(alltags) == len(tagtypes) == 0, \ |
|
|||
97 | "findglobaltags() should be called first" |
|
|||
98 |
|
93 | |||
99 | (heads, tagfnode, valid, cachetags, shouldwrite) = _readtagcache(ui, repo) |
|
94 | (heads, tagfnode, valid, cachetags, shouldwrite) = _readtagcache(ui, repo) | |
100 | if cachetags is not None: |
|
95 | if cachetags is not None: | |
@@ -103,7 +98,7 b' def findglobaltags(ui, repo, alltags, ta' | |||||
103 | # cases where a global tag should outrank a local tag but won't, |
|
98 | # cases where a global tag should outrank a local tag but won't, | |
104 | # because cachetags does not contain rank info? |
|
99 | # because cachetags does not contain rank info? | |
105 | _updatetags(cachetags, 'global', alltags, tagtypes) |
|
100 | _updatetags(cachetags, 'global', alltags, tagtypes) | |
106 | return |
|
101 | return alltags, tagtypes | |
107 |
|
102 | |||
108 | seen = set() # set of fnode |
|
103 | seen = set() # set of fnode | |
109 | fctx = None |
|
104 | fctx = None | |
@@ -125,6 +120,7 b' def findglobaltags(ui, repo, alltags, ta' | |||||
125 | # and update the cache (if necessary) |
|
120 | # and update the cache (if necessary) | |
126 | if shouldwrite: |
|
121 | if shouldwrite: | |
127 | _writetagcache(ui, repo, valid, alltags) |
|
122 | _writetagcache(ui, repo, valid, alltags) | |
|
123 | return alltags, tagtypes | |||
128 |
|
124 | |||
129 | def readlocaltags(ui, repo, alltags, tagtypes): |
|
125 | def readlocaltags(ui, repo, alltags, tagtypes): | |
130 | '''Read local tags in repo. Update alltags and tagtypes.''' |
|
126 | '''Read local tags in repo. Update alltags and tagtypes.''' |
General Comments 0
You need to be logged in to leave comments.
Login now