Mercurial > hg
comparison mercurial/util.py @ 3568:23f7d9621783
Merge with upstream
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 27 Oct 2006 23:09:46 +0200 |
parents | eda9e7c9300d 4d97184a06ad |
children | 4cfb72bcb978 |
comparison
equal
deleted
inserted
replaced
3567:3bab1fc0ab75 | 3568:23f7d9621783 |
---|---|
126 return False | 126 return False |
127 | 127 |
128 def unique(g): | 128 def unique(g): |
129 """return the uniq elements of iterable g""" | 129 """return the uniq elements of iterable g""" |
130 seen = {} | 130 seen = {} |
131 l = [] | |
131 for f in g: | 132 for f in g: |
132 if f not in seen: | 133 if f not in seen: |
133 seen[f] = 1 | 134 seen[f] = 1 |
134 yield f | 135 l.append(f) |
136 return l | |
135 | 137 |
136 class Abort(Exception): | 138 class Abort(Exception): |
137 """Raised if a command needs to print an error and exit.""" | 139 """Raised if a command needs to print an error and exit.""" |
138 | 140 |
139 class UnexpectedOutput(Abort): | 141 class UnexpectedOutput(Abort): |
983 if f >= 0: | 985 if f >= 0: |
984 user = user[f+1:] | 986 user = user[f+1:] |
985 f = user.find(' ') | 987 f = user.find(' ') |
986 if f >= 0: | 988 if f >= 0: |
987 user = user[:f] | 989 user = user[:f] |
990 f = user.find('.') | |
991 if f >= 0: | |
992 user = user[:f] | |
988 return user | 993 return user |
989 | 994 |
990 def walkrepos(path): | 995 def walkrepos(path): |
991 '''yield every hg repository under path, recursively.''' | 996 '''yield every hg repository under path, recursively.''' |
992 def errhandler(err): | 997 def errhandler(err): |