203 if key in filetags: |
203 if key in filetags: |
204 n, h = filetags[key] |
204 n, h = filetags[key] |
205 h.append(n) |
205 h.append(n) |
206 filetags[key] = (bin_n, h) |
206 filetags[key] = (bin_n, h) |
207 |
207 |
208 for k,nh in filetags.items(): |
208 for k, nh in filetags.items(): |
209 if k not in globaltags: |
209 if k not in globaltags: |
210 globaltags[k] = nh |
210 globaltags[k] = nh |
211 continue |
211 continue |
212 # we prefer the global tag if: |
212 # we prefer the global tag if: |
213 # it supercedes us OR |
213 # it supercedes us OR |
214 # mutual supercedes and it has a higher rank |
214 # mutual supercedes and it has a higher rank |
215 # otherwise we win because we're tip-most |
215 # otherwise we win because we're tip-most |
216 an, ah = nh |
216 an, ah = nh |
217 bn, bh = globaltags[k] |
217 bn, bh = globaltags[k] |
218 if bn != an and an in bh and \ |
218 if (bn != an and an in bh and |
219 (bn not in ah or len(bh) > len(ah)): |
219 (bn not in ah or len(bh) > len(ah))): |
220 an = bn |
220 an = bn |
221 ah.extend([n for n in bh if n not in ah]) |
221 ah.extend([n for n in bh if n not in ah]) |
222 globaltags[k] = an, ah |
222 globaltags[k] = an, ah |
223 |
223 |
224 # read the tags file from each head, ending with the tip |
224 # read the tags file from each head, ending with the tip |
669 else: |
669 else: |
670 branchname = "" |
670 branchname = "" |
671 |
671 |
672 if use_dirstate: |
672 if use_dirstate: |
673 oldname = c1[5].get("branch") # stored in UTF-8 |
673 oldname = c1[5].get("branch") # stored in UTF-8 |
674 if not commit and not remove and not force and p2 == nullid and \ |
674 if (not commit and not remove and not force and p2 == nullid |
675 branchname == oldname: |
675 and branchname == oldname): |
676 self.ui.status(_("nothing changed\n")) |
676 self.ui.status(_("nothing changed\n")) |
677 return None |
677 return None |
678 |
678 |
679 xp1 = hex(p1) |
679 xp1 = hex(p1) |
680 if p2 == nullid: xp2 = '' |
680 if p2 == nullid: xp2 = '' |