Changeset 581
- Timestamp:
- 10/31/04 16:16:40 (4 years ago)
- Files:
-
- trunk/Makefile.am (modified) (1 diff)
- trunk/aux/svn2log.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Makefile.am
r578 r581 17 17 cl-stamp: .svn/entries 18 18 TZ=UTC svn log -v --xml \ 19 | aux/svn2log.py -p '/(branches/[^/]+|trunk)' -x ChangeLog -u aux/users 19 | aux/svn2log.py -p '/(branches/[^/]+|trunk)' -x ChangeLog -u aux/users -F 20 20 touch cl-stamp 21 21 trunk/aux/svn2log.py
r567 r581 44 44 reloc = { } 45 45 max_join_delta = 3 * 60 46 list_format = False 46 47 47 48 date_rx = re.compile(r"^(\d+-\d+-\d+T\d+:\d+:\d+)") … … 85 86 return "%s <%s@%s>" % (u, u, default_domain) 86 87 87 def wrap_text (str, pref, width):88 ret = ""89 line = ""88 def wrap_text_line(str, pref, width): 89 ret = u"" 90 line = u"" 90 91 first_line = True 91 92 for word in str.split(): 92 if line == "":93 if line == u"": 93 94 line = word 94 95 else: 95 if len(line + " " + word) > width:96 if len(line + u" " + word) > width: 96 97 if first_line: 97 ret += line + "\n"98 ret += line + u"\n" 98 99 first_line = False 99 100 line = word 100 101 else: 101 ret += pref + line + "\n"102 ret += pref + line + u"\n" 102 103 line = word 103 104 else: 104 line += " " + word105 line += u" " + word 105 106 if first_line: 106 ret += line + "\n"107 else: 108 ret += pref + line + "\n"107 ret += line + u"\n" 108 else: 109 ret += pref + line + u"\n" 109 110 return ret 111 112 def wrap_text(str, pref, width): 113 if not list_format: 114 return wrap_text_line(str,pref,width) 115 else: 116 items = re.split(r"\-\s+",str) 117 ret = wrap_text_line(items[0],pref,width) 118 for item in items[1:]: 119 ret += pref + u"- " + wrap_text_line(item,pref+" ",width) 120 return ret 110 121 111 122 class Entry: … … 126 137 if self.rev != self.beg_rev: 127 138 out.write("%s [r%s-%s] %s\n\n" % \ 128 (time.strftime("%Y-%m-%d %H:%M ", time.gmtime(self.beg_tm)), \139 (time.strftime("%Y-%m-%d %H:%M +0000", time.localtime(self.beg_tm)), \ 129 140 self.rev, self.beg_rev, convert_user(self.author))) 130 141 else: 131 142 out.write("%s [r%s] %s\n\n" % \ 132 (time.strftime("%Y-%m-%d %H:%M ", time.gmtime(self.beg_tm)), \143 (time.strftime("%Y-%m-%d %H:%M +0000", time.localtime(self.beg_tm)), \ 133 144 self.rev, convert_user(self.author))) 134 145 out.write(self.msg) … … 201 212 -d, --domain=DOMAIN set default domain for logins not listed in users file 202 213 -u, --users=FILE read logins from specified file 214 -F, --list-format format commit logs with enumerated change list (items 215 prefixed by '- ') 203 216 -r, --relocate=X=Y before doing any other operations on paths, replace 204 217 X with Y (useful for directory moves) … … 229 242 def process_opts(): 230 243 try: 231 opts, args = getopt.gnu_getopt(sys.argv[1:], "o:u:p:x:d:r:d: h",244 opts, args = getopt.gnu_getopt(sys.argv[1:], "o:u:p:x:d:r:d:D:Fh", 232 245 ["users=", "prefix=", "domain=", "delta=", 233 "exclude=", "help", "output=", "relocate="]) 246 "exclude=", "help", "output=", "relocate=", 247 "list-format"]) 234 248 except getopt.GetoptError: 235 249 usage() … … 237 251 fin = sys.stdin 238 252 fout = None 239 global kill_prefix_rx, exclude, users, default_domain, reloc, max_join_delta 253 global kill_prefix_rx, exclude, users, default_domain, reloc, max_join_delta, list_format 240 254 for o, a in opts: 241 255 if o in ("--prefix", "-p"): … … 262 276 elif o in ("--delta", "-D"): 263 277 max_join_delta = int(a) 278 elif o in ("--list-format", "-F"): 279 list_format = True 264 280 else: 265 281 usage()
