Mercurial > hg
comparison hgext/convert/cvsps.py @ 6762:f67d1468ac50
util: add sort helper
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 27 Jun 2008 18:28:45 -0500 |
parents | 386561a5179a |
children | 12472a240398 |
comparison
equal
deleted
inserted
replaced
6761:cb981fc955fb | 6762:f67d1468ac50 |
---|---|
295 e.comment.append(line) | 295 e.comment.append(line) |
296 | 296 |
297 if store: | 297 if store: |
298 # clean up the results and save in the log. | 298 # clean up the results and save in the log. |
299 store = False | 299 store = False |
300 e.tags = [scache(x) for x in tags.get(e.revision, [])] | 300 e.tags = util.sort([scache(x) for x in tags.get(e.revision, [])]) |
301 e.tags.sort() | |
302 e.comment = scache('\n'.join(e.comment)) | 301 e.comment = scache('\n'.join(e.comment)) |
303 | 302 |
304 revn = len(e.revision) | 303 revn = len(e.revision) |
305 if revn > 3 and (revn % 2) == 0: | 304 if revn > 3 and (revn % 2) == 0: |
306 e.branch = tags.get(e.revision[:-1], [None])[0] | 305 e.branch = tags.get(e.revision[:-1], [None])[0] |
466 tags = {} | 465 tags = {} |
467 for e in c.entries: | 466 for e in c.entries: |
468 for tag in e.tags: | 467 for tag in e.tags: |
469 tags[tag] = True | 468 tags[tag] = True |
470 # remember tags only if this is the latest changeset to have it | 469 # remember tags only if this is the latest changeset to have it |
471 tagnames = [tag for tag in tags if globaltags[tag] is c] | 470 c.tags = util.sort([tag for tag in tags if globaltags[tag] is c]) |
472 tagnames.sort() | |
473 c.tags = tagnames | |
474 | 471 |
475 # Find parent changesets, handle {{mergetobranch BRANCHNAME}} | 472 # Find parent changesets, handle {{mergetobranch BRANCHNAME}} |
476 # by inserting dummy changesets with two parents, and handle | 473 # by inserting dummy changesets with two parents, and handle |
477 # {{mergefrombranch BRANCHNAME}} by setting two parents. | 474 # {{mergefrombranch BRANCHNAME}} by setting two parents. |
478 | 475 |