Mercurial > public > mercurial-scm > hg
comparison mercurial/manifest.py @ 6762:f67d1468ac50
util: add sort helper
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 27 Jun 2008 18:28:45 -0500 |
parents | 51b0e799352f |
children | be142cb994ff |
comparison
equal
deleted
inserted
replaced
6761:cb981fc955fb | 6762:f67d1468ac50 |
---|---|
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 from node import bin, hex, nullid | 8 from node import bin, hex, nullid |
9 from revlog import revlog, RevlogError | 9 from revlog import revlog, RevlogError |
10 from i18n import _ | 10 from i18n import _ |
11 import array, struct, mdiff, parsers | 11 import array, struct, mdiff, parsers, util |
12 | 12 |
13 class manifestdict(dict): | 13 class manifestdict(dict): |
14 def __init__(self, mapping=None, flags=None): | 14 def __init__(self, mapping=None, flags=None): |
15 if mapping is None: mapping = {} | 15 if mapping is None: mapping = {} |
16 if flags is None: flags = {} | 16 if flags is None: flags = {} |
124 raise RevlogError(_("'\\n' and '\\r' disallowed in filenames")) | 124 raise RevlogError(_("'\\n' and '\\r' disallowed in filenames")) |
125 | 125 |
126 # if we're using the listcache, make sure it is valid and | 126 # if we're using the listcache, make sure it is valid and |
127 # parented by the same node we're diffing against | 127 # parented by the same node we're diffing against |
128 if not (changed and self.listcache and p1 and self.mapcache[0] == p1): | 128 if not (changed and self.listcache and p1 and self.mapcache[0] == p1): |
129 files = map.keys() | 129 files = util.sort(map) |
130 files.sort() | |
131 | |
132 for f in files: | 130 for f in files: |
133 checkforbidden(f) | 131 checkforbidden(f) |
134 | 132 |
135 # if this is changed to support newlines in filenames, | 133 # if this is changed to support newlines in filenames, |
136 # be sure to check the templates/ dir again (especially *-raw.tmpl) | 134 # be sure to check the templates/ dir again (especially *-raw.tmpl) |