comparison mercurial/commands.py @ 1061:fed8d078840b

Fix set type usage for Python 2.3
author mpm@selenic.com
date Fri, 26 Aug 2005 02:03:35 -0700
parents e453d2053b2e
children 6d5a62a549fa
comparison
equal deleted inserted replaced
1060:e453d2053b2e 1061:fed8d078840b
7 7
8 from demandload import demandload 8 from demandload import demandload
9 demandload(globals(), "os re sys signal shutil") 9 demandload(globals(), "os re sys signal shutil")
10 demandload(globals(), "fancyopts ui hg util lock") 10 demandload(globals(), "fancyopts ui hg util lock")
11 demandload(globals(), "fnmatch hgweb mdiff random signal time traceback") 11 demandload(globals(), "fnmatch hgweb mdiff random signal time traceback")
12 demandload(globals(), "errno socket version struct atexit") 12 demandload(globals(), "errno socket version struct atexit sets")
13 13
14 class UnknownCommand(Exception): 14 class UnknownCommand(Exception):
15 """Exception raised if command is not in the command table.""" 15 """Exception raised if command is not in the command table."""
16 16
17 def filterfiles(filters, files): 17 def filterfiles(filters, files):
839 s = linestate(line, lnum, cstart, cend) 839 s = linestate(line, lnum, cstart, cend)
840 m[s] = s 840 m[s] = s
841 841
842 prev = {} 842 prev = {}
843 def display(fn, rev, states, prevstates): 843 def display(fn, rev, states, prevstates):
844 diff = list(set(states).symmetric_difference(set(prevstates))) 844 diff = list(sets.Set(states).symmetric_difference(sets.Set(prevstates)))
845 diff.sort(lambda x, y: cmp(x.linenum, y.linenum)) 845 diff.sort(lambda x, y: cmp(x.linenum, y.linenum))
846 for l in diff: 846 for l in diff:
847 if incrementing: 847 if incrementing:
848 change = ((l in prevstates) and '-') or '+' 848 change = ((l in prevstates) and '-') or '+'
849 r = rev 849 r = rev