Sun Nov 13 11:23:24 UTC 2011 pinterface <pix@kepibu.org>
* Add support for calling an external program to generate README markup
{
hunk ./config.py.sample 87
+ # If you'd like a wider range of README file types than darcsweb
+ # provides, set readme_converter to a program which takes a single
+ # argument--the name of the readme file--and outputs HTML.
+ #readme_converter = 'ruby -rubygems /var/lib/gems/1.8/gems/github-markup-0.5.3/bin/github-markup'
hunk ./darcsweb.cgi 1094
+def get_readme():
+ import glob
+ readmes = glob.glob("README*")
+ if len(readmes) == 0: return False, False
+ import re
+ for p in readmes:
+ file = os.path.basename(p)
+ if re.search('\.(md|markdown)$', p):
+ import codecs
+ import markdown
+ f = codecs.open(p, encoding=config.repoencoding[0])
+ str = f.read()
+ html = markdown.markdown(str, ['extra', 'codehilite(css_class=page_body)'])
+ return file, fixu8(html)
+ elif re.search('README$', p):
+ f = open(p)
+ str = f.read()
+ return file, '<pre>%s</pre>' % fixu8(escape(str))
+ # We can't handle this ourselves, try shelling out
+ if not config.readme_converter: return False, False
+ cmd = '%s "%s"' % (config.readme_converter, readmes[0])
+ inf, outf = os.popen2(cmd, 't')
+ return os.path.basename(readmes[0]), fixu8(outf.read())
hunk ./darcsweb.cgi 1248
-# FIXME: shell out to github-markup to avoid duplicating that effort here?
hunk ./darcsweb.cgi 1249
- real = False
- for p in ["README", "README.md", "README.markdown"]:
- p = realpath(p)
- if p and os.path.isfile(p):
- real = p
- break
- if not real: return
-
- print '<div class="title">%s</div>' % os.path.basename(real)
-
- import re
- if re.search('\.(md|markdown)$', real):
- import codecs
- import markdown
- f = codecs.open(real, encoding=config.repoencoding[0])
- str = f.read()
- html = markdown.markdown(str, ['extra', 'codehilite(css_class=page_body)'])
- print '<section>%s</section>' % fixu8(html)
- else:
- f = open(real)
- str = f.read()
- print '<section><pre>%s</pre></section>' % fixu8(escape(str))
+ head, body = get_readme()
+ if not head: return False
+ print '<div class="title">%s</div>' % head
+ print '<section>%s</section' % body
hunk ./darcsweb.cgi 2566
+ if "readme_converter" in dir(base):
+ config.readme_converter = base.readme_converter
+ else:
+ config.readme_converter = False
+
}
Sun Nov 13 11:07:41 UTC 2011 pinterface <pix@kepibu.org>
* minidom chokes on form feed character
hunk ./darcsweb.cgi 1002
- s += fixu8(i)
+ s += fixu8(i).replace('[_^L_]', '^L')
Sat Nov 5 10:18:50 UTC 2011 pinterface <pix@kepibu.org>
* Show README in summary view, if it exists
Blatantly stealing the idea from Github, but not as fully implemented.
{
hunk ./darcsweb.cgi 1225
+# FIXME: shell out to github-markup to avoid duplicating that effort here?
+def print_readme():
+ real = False
+ for p in ["README", "README.md", "README.markdown"]:
+ p = realpath(p)
+ if p and os.path.isfile(p):
+ real = p
+ break
+ if not real: return
+
+ print '<div class="title">%s</div>' % os.path.basename(real)
+
+ import re
+ if re.search('\.(md|markdown)$', real):
+ import codecs
+ import markdown
+ f = codecs.open(real, encoding=config.repoencoding[0])
+ str = f.read()
+ html = markdown.markdown(str, ['extra', 'codehilite(css_class=page_body)'])
+ print '<section>%s</section>' % fixu8(html)
+ else:
+ f = open(real)
+ str = f.read()
+ print '<section><pre>%s</pre></section>' % fixu8(escape(str))
+
+
hunk ./darcsweb.cgi 1523
+ print_readme()
}
Tue Nov 1 10:19:57 UTC 2011 pinterface <pix@kepibu.org>
* Add Owner and Last Change columns to repo listing
This is a little ugly due to the global config object. Boo.
{
hunk ./darcsweb.cgi 2247
+<th>Owner</th>
+<th>Last Change</th>
hunk ./darcsweb.cgi 2273
+ try: orig_repodir = config.repodir
+ except: orig_repodir = None
+ config.repodir = c.repodir
hunk ./darcsweb.cgi 2279
+<td>%(owner)s</td>
+<td>%(lastchange)s</td>
hunk ./darcsweb.cgi 2291
- 'desc': shorten_str(desc, 60)
+ 'desc': shorten_str(desc, 60),
+ 'owner': escape(repo_get_owner() or ''),
+ 'lastchange': how_old(os.stat(c.repodir + '/_darcs/patches').st_mtime),
hunk ./darcsweb.cgi 2295
+ config.repodir = orig_repodir
}
Tue Nov 1 09:54:21 UTC 2011 pinterface <pix@kepibu.org>
* Skip comments and blank lines in the author file
{
hunk ./darcsweb.cgi 634
- author = fd.readlines()[0].strip()
+ for line in fd:
+ line = line.strip()
+ if line != "" and line[0] != "#":
+ return line.strip()
hunk ./darcsweb.cgi 639
- author = None
- return author
+ return None
}
Tue Nov 1 08:30:12 UTC 2011 pinterface <pix@kepibu.org>
* Add ability to specify a mailing list URL for repositories
{
hunk ./darcsweb.cgi 1488
+ if config.repolisturl:
+ print ' <tr><td>mailing list url</td>'
+ print ' <td><a href="%(url)s">%(url)s</a></td></tr>' % \
+ { 'url': config.repolisturl }
hunk ./darcsweb.cgi 2378
+ if 'autolisturl' in dir(c) and c.autolisturl:
+ dpath = fulldir + \
+ '/_darcs/third_party/darcsweb/listurl'
+ if os.access(dpath, os.R_OK):
+ listurl = open(dpath).readline().rstrip("\n")
+ elif 'repolisturl' in dir(c):
+ listurl = c.repolisturl % rep_dict
+ else:
+ listurl = None
+ elif 'repolisturl' in dir(c):
+ listurl = c.repolisturl % rep_dict
+ else:
+ listurl = None
+
hunk ./darcsweb.cgi 2400
+ repolisturl = listurl
hunk ./darcsweb.cgi 2463
+ config.repolisturl = None
+ if 'repolisturl' in dir(c):
+ config.repolisturl = c.repolisturl
+
}
Tue Nov 1 08:12:39 UTC 2011 pinterface <pix@kepibu.org>
* Don't require myurl be specified when cachedir is in use
hunk ./darcsweb.cgi 2417
- if 'myurl' not in dir(base) and 'cachedir' not in dir(base):
+ if 'myurl' not in dir(base):
Wed Nov 24 15:52:33 UTC 2010 Alberto Bertogli <albertito@blitiri.com.ar>
tagged 1.2-rc1
{
}
Fri Oct 15 12:55:46 UTC 2010 Dave Love <fx@gnu.org>
* Use diff --quiet.
Prevents `Copying pristine' messages in output with darcs pre-2.5.
{
hunk ./darcsweb.cgi 685
- params = 'diff -u --match "hash %s"' % self.hash
+ params = 'diff --quiet -u --match "hash %s"' % self.hash
hunk ./darcsweb.cgi 931
- return run_darcs('diff -u --match "hash %s"' % hash)
+ return run_darcs('diff --quiet -u --match "hash %s"' % hash)
hunk ./darcsweb.cgi 934
- return run_darcs('diff -u --match "hash %s" "%s"' % (hash, fname))
+ return run_darcs('diff --quiet -u --match "hash %s" "%s"' % (hash, fname))
hunk ./darcsweb.cgi 937
- return run_darcs('diff -u --from-match "hash %s" "%s"' % (hash, fname))
+ return run_darcs('diff --quiet -u --from-match "hash %s" "%s"' % (hash, fname))
hunk ./darcsweb.cgi 940
- return run_darcs('diff -u --from-match "hash %s"' % hash)
+ return run_darcs('diff --quiet -u --from-match "hash %s"' % hash)
}
Fri Jun 25 00:32:55 UTC 2010 Alberto Bertogli <albertito@blitiri.com.ar>
* Do not use string exceptions
String exceptions are deprecated and will soon no longer be supported at all.
Most of the instances of string exceptions in our code were not meant to be
catched, but just to get meaningful backtraces.
This patch replaces them with appropriate, usually generic, exceptions that
serve the same purpose.
{
hunk ./darcsweb.cgi 82
- raise 'FilterFile FAILED'
+ raise Exception, 'FilterFile FAILED'
hunk ./darcsweb.cgi 119
- raise 'DecodingError', config.repoencoding
+ raise UnicodeDecodeError, config.repoencoding
hunk ./darcsweb.cgi 2407
- raise "RepoNotFound", name
+ raise Exception, "Repo not found: " + repr(name)
}
Sun Mar 28 18:21:44 UTC 2010 Simon Michael <simon@joyful.com>
* log view: display the patch name just once, tighten up whitespace
hunk ./darcsweb.cgi 1253
- %(desc)s<br/>
- <br/>
Sun Mar 28 16:40:18 UTC 2010 Simon Michael <simon@joyful.com>
* allow custom "last" value in url, eg to view all patches on one page
{
hunk ./darcsweb.cgi 26
+PATCHES_PER_PAGE = 50
+
hunk ./darcsweb.cgi 1149
-def print_shortlog(last = 50, topi = 0, fname = None):
+def print_shortlog(last = PATCHES_PER_PAGE, topi = 0, fname = None):
hunk ./darcsweb.cgi 1223
-def print_log(last = 50, topi = 0):
+def print_log(last = PATCHES_PER_PAGE, topi = 0):
hunk ./darcsweb.cgi 1988
-def do_shortlog(topi):
+def do_shortlog(topi, last=PATCHES_PER_PAGE):
hunk ./darcsweb.cgi 1991
- print_shortlog(topi = topi)
+ print_shortlog(topi = topi, last = last)
hunk ./darcsweb.cgi 1994
-def do_filehistory(topi, f):
+def do_filehistory(topi, f, last=PATCHES_PER_PAGE):
hunk ./darcsweb.cgi 1997
- print_shortlog(topi = topi, fname = fname)
+ print_shortlog(topi = topi, fname = fname, last = last)
hunk ./darcsweb.cgi 2000
-def do_log(topi):
+def do_log(topi, last=PATCHES_PER_PAGE):
hunk ./darcsweb.cgi 2003
- print_log(topi = topi)
+ print_log(topi = topi, last = last)
hunk ./darcsweb.cgi 2537
- params = ['r', 'a', 'f', 'h', 'topi']
+ params = ['r', 'a', 'f', 'h', 'topi', 'last']
hunk ./darcsweb.cgi 2642
- do_shortlog(topi)
+ if form.has_key("last"):
+ last = int(filter_num(form["last"].value))
+ else:
+ last = PATCHES_PER_PAGE
+ do_shortlog(topi=topi,last=last)
hunk ./darcsweb.cgi 2654
- do_filehistory(topi, fname)
+ if form.has_key("last"):
+ last = int(filter_num(form["last"].value))
+ else:
+ last = PATCHES_PER_PAGE
+ do_filehistory(topi, fname, last=last)
hunk ./darcsweb.cgi 2665
- do_log(topi)
+ if form.has_key("last"):
+ last = int(filter_num(form["last"].value))
+ else:
+ last = PATCHES_PER_PAGE
+ do_log(topi, last=last)
}
Sun Mar 28 16:37:55 UTC 2010 Simon Michael <simon@joyful.com>
* hide darcs' Ignore-this: metadata in log view
{
hunk ./darcsweb.cgi 193
+def strip_ignore_this(s):
+ """Strip out darcs' Ignore-this: metadata if present."""
+ import re
+ return re.sub(r'^Ignore-this:[^\n]*\n?','',s)
hunk ./darcsweb.cgi 848
- self.db[self.current].comment = fixu8(self.cur_val)
+ self.db[self.current].comment = fixu8(strip_ignore_this(self.cur_val))
}
Sun Mar 28 18:57:50 UTC 2010 Simon Michael <simon@joyful.com>
* more robust timestamp parsing
With this, darcsweb can list the full darcs repo log.
{
hunk ./darcsweb.cgi 305
- # "Wed May 21 19:39:10 CEST 2003"
- # we can't parse the "CEST" part reliably, so we leave it out
+ # "Wed May 21 19:39:10 CEST 2003" or even:
+ # "Sun Sep 21 07:23:57 Pacific Daylight Time 2003"
+ # we can't parse the time zone part reliably, so we ignore it
hunk ./darcsweb.cgi 310
- ns = ' '.join(parts[0:4]) + ' ' + parts[5]
+ ns = ' '.join(parts[0:4]) + ' ' + parts[-1]
}
Thu Mar 26 19:58:42 UTC 2009 gaetan.lehmann@jouy.inra.fr
* add the year in the date field if the patch wasn't made in the current year
hunk ./darcsweb.cgi 131
- s = time.strftime("%d %b %H:%M", t)
+ currentYear = time.localtime()[0]
+ if t[0] == currentYear:
+ s = time.strftime("%d %b %H:%M", t)
+ else:
+ s = time.strftime("%d %b %Y %H:%M", t)
Tue Oct 28 15:44:36 UTC 2008 Alberto Bertogli <albertito@blitiri.com.ar>
tagged 1.1
{
}
Tue Oct 28 15:43:41 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Update my email address
{
hunk ./README 3
-Alberto Bertogli (albertito@gmail.com)
-----------------------------------------
+Alberto Bertogli (albertito@blitiri.com.ar)
+---------------------------------------------
hunk ./darcsweb.cgi 5
-Alberto Bertogli (albertito@gmail.com)
+Alberto Bertogli (albertito@blitiri.com.ar)
hunk ./darcsweb.cgi 322
- Alberto Bertogli (albertito@gmail.com).
+ Alberto Bertogli (albertito@blitiri.com.ar).
hunk ./style.css 3
- * Alberto Bertogli (albertito@gmail.com)
+ * Alberto Bertogli (albertito@blitiri.com.ar)
}
Tue Aug 12 09:50:07 UTC 2008 Alexandre Rossi <alexandre.rossi@gmail.com>
* fix pygments disaligned linenos and code when using windows fonts (pygments>0.7 only)
{
hunk ./darcsweb.cgi 1327
- formatter = pygments.formatters.HtmlFormatter(linenos=True,
+
+ pygments_version = map(int, pygments.__version__.split('.'))
+ if pygments_version >= [0, 7]:
+ linenos_method = 'inline'
+ else:
+ linenos_method = True
+ formatter = pygments.formatters.HtmlFormatter(linenos=linenos_method,
hunk ./darcsweb.cgi 1335
+
}
Tue Oct 14 21:18:42 UTC 2008 Alberto Bertogli <albertito@gmail.com>
tagged 1.1-rc1
{
}
Tue Oct 14 21:18:29 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Update HTML version number
hunk ./darcsweb.cgi 321
-<!-- darcsweb 1.0
+<!-- darcsweb 1.1
Sun Oct 5 15:53:16 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Import pygments only when needed
Otherwise, we pay for the pygments import (which is noticeable) on every
darcsweb page view.
This follows the lazy module loading that is already being done for other
costly modules (i.e. 're').
{
hunk ./darcsweb.cgi 22
-try:
- import pygments
- import pygments.lexers
- import pygments.formatters
-except ImportError:
- pygments = False
-
hunk ./darcsweb.cgi 1273
+ try:
+ import pygments
+ except ImportError:
+ pygments = False
+
hunk ./darcsweb.cgi 1316
+ import pygments
+ import pygments.lexers
+ import pygments.formatters
+
}
Sun Oct 5 15:48:31 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Ignore broken multidir directories
When a multidir directory is not really a directory or a valid symlink to one,
we want to skip it instead of exploding.
This patch fixes that by doing a simple sanity check while processing the
configured multidirs.
Thanks to Ralph Giles <giles@ghostscript.com> for the report and the patch.
hunk ./darcsweb.cgi 2278
+ if not os.path.isdir(c.multidir):
+ continue
+
Thu Aug 7 05:31:41 UTC 2008 Alexandre Rossi <alexandre.rossi@gmail.com>
* optional source headblob syntax highlighting using python-pygments
{
hunk ./darcsweb.cgi 22
+try:
+ import pygments
+ import pygments.lexers
+ import pygments.formatters
+except ImportError:
+ pygments = False
+
hunk ./darcsweb.cgi 1272
- print '<div class="page_body">'
hunk ./darcsweb.cgi 1274
+<div class="page_body">
hunk ./darcsweb.cgi 1280
+ if not pygments:
+ print_blob_simple(fname)
+ return
+ else:
+ try:
+ print_blob_highlighted(fname)
+ except ValueError:
+ # pygments couldn't guess a lexer to highlight the code, try
+ # another method with sampling the file contents.
+ try:
+ print_blob_highlighted(fname, sample_code=True)
+ except ValueError:
+ # pygments really could not find any lexer for this file.
+ print_blob_simple(fname)
+
+def print_blob_simple(fname):
+ print '<div class="page_body">'
+
hunk ./darcsweb.cgi 1317
+def print_blob_highlighted(fname, sample_code=False):
+ code = open(realpath(fname), 'r').read()
+ if sample_code:
+ lexer = pygments.lexers.guess_lexer(code[:200],
+ encoding=config.repoencoding[0])
+ else:
+ lexer = pygments.lexers.guess_lexer_for_filename(fname, code[:200],
+ encoding=config.repoencoding[0])
+ formatter = pygments.formatters.HtmlFormatter(linenos=True,
+ cssclass='page_body')
+ print pygments.highlight(code, lexer, formatter)
+
hunk ./style.css 223
-a.linenr {
+a.linenr, .linenos {
hunk ./style.css 266
+/* Syntax highlighting related styles. This is highly dependent on what
+ * python-pygments generates.
+ * This was generated using the following commands in a python interpreter and
+ * slightly modified after.
+ * >>> import pygments
+ * >>> pygments.formatters.HtmlFormatter().get_style_defs('.page_body')
+ */
+.page_body table { margin: 0; padding: 0;}
+.page_body pre { margin : 0; padding: 0; }
+.page_body .c { color: #008800; font-style: italic } /* Comment */
+.page_body .err { border: 1px solid #FF0000 } /* Error */
+.page_body .k { color: #AA22FF; font-weight: bold } /* Keyword */
+.page_body .o { color: #666666 } /* Operator */
+.page_body .cm { color: #008800; font-style: italic } /* Comment.Multiline */
+.page_body .cp { color: #008800 } /* Comment.Preproc */
+.page_body .c1 { color: #008800; font-style: italic } /* Comment.Single */
+.page_body .gd { color: #A00000 } /* Generic.Deleted */
+.page_body .ge { font-style: italic } /* Generic.Emph */
+.page_body .gr { color: #FF0000 } /* Generic.Error */
+.page_body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.page_body .gi { color: #00A000 } /* Generic.Inserted */
+.page_body .go { color: #808080 } /* Generic.Output */
+.page_body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+.page_body .gs { font-weight: bold } /* Generic.Strong */
+.page_body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.page_body .gt { color: #0040D0 } /* Generic.Traceback */
+.page_body .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */
+.page_body .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */
+.page_body .kp { color: #AA22FF } /* Keyword.Pseudo */
+.page_body .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */
+.page_body .kt { color: #AA22FF; font-weight: bold } /* Keyword.Type */
+.page_body .m { color: #666666 } /* Literal.Number */
+.page_body .s { color: #BB4444 } /* Literal.String */
+.page_body .na { color: #BB4444 } /* Name.Attribute */
+.page_body .nb { color: #AA22FF } /* Name.Builtin */
+.page_body .nc { color: #0000FF } /* Name.Class */
+.page_body .no { color: #880000 } /* Name.Constant */
+.page_body .nd { color: #AA22FF } /* Name.Decorator */
+.page_body .ni { color: #999999; font-weight: bold } /* Name.Entity */
+.page_body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+.page_body .nf { color: #00A000 } /* Name.Function */
+.page_body .nl { color: #A0A000 } /* Name.Label */
+.page_body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+.page_body .nt { color: #008000; font-weight: bold } /* Name.Tag */
+.page_body .nv { color: #B8860B } /* Name.Variable */
+.page_body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+.page_body .mf { color: #666666 } /* Literal.Number.Float */
+.page_body .mh { color: #666666 } /* Literal.Number.Hex */
+.page_body .mi { color: #666666 } /* Literal.Number.Integer */
+.page_body .mo { color: #666666 } /* Literal.Number.Oct */
+.page_body .sb { color: #BB4444 } /* Literal.String.Backtick */
+.page_body .sc { color: #BB4444 } /* Literal.String.Char */
+.page_body .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */
+.page_body .s2 { color: #BB4444 } /* Literal.String.Double */
+.page_body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+.page_body .sh { color: #BB4444 } /* Literal.String.Heredoc */
+.page_body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+.page_body .sx { color: #008000 } /* Literal.String.Other */
+.page_body .sr { color: #BB6688 } /* Literal.String.Regex */
+.page_body .s1 { color: #BB4444 } /* Literal.String.Single */
+.page_body .ss { color: #B8860B } /* Literal.String.Symbol */
+.page_body .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
+.page_body .vc { color: #B8860B } /* Name.Variable.Class */
+.page_body .vg { color: #B8860B } /* Name.Variable.Global */
+.page_body .vi { color: #B8860B } /* Name.Variable.Instance */
+.page_body .il { color: #666666 } /* Literal.Number.Integer.Long */
+
}
Thu Aug 7 04:41:45 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Handle old date formats
Very old darcs commits use a different time format, that leaks out in some
operations like annotate. This patch makes darcsweb able to handle it.
Thanks to Simon Michael <simon@joyful.com> for the report and the help.
{
hunk ./darcsweb.cgi 295
+def parse_darcs_time(s):
+ "Try to convert a darcs' time string into a Python time tuple."
+ try:
+ return time.strptime(s, "%Y%m%d%H%M%S")
+ except ValueError:
+ # very old darcs commits use a different format, for example:
+ # "Wed May 21 19:39:10 CEST 2003"
+ # we can't parse the "CEST" part reliably, so we leave it out
+ fmt = "%a %b %d %H:%M:%S %Y"
+ parts = s.split()
+ ns = ' '.join(parts[0:4]) + ' ' + parts[5]
+ return time.strptime(ns, fmt)
+
+
+
hunk ./darcsweb.cgi 751
- td = time.strptime(attrs.get('date', None),
- "%Y%m%d%H%M%S")
+ td = parse_darcs_time(attrs.get('date', None))
hunk ./darcsweb.cgi 1011
- lastdate = lastpatch.getAttribute("date")
- lastdate = time.strptime(lastdate, "%Y%m%d%H%M%S")
+ lastdate = parse_darcs_time(lastpatch.getAttribute("date"))
hunk ./darcsweb.cgi 1033
- pdate = time.strptime(pdate, "%Y%m%d%H%M%S")
+ pdate = parse_darcs_time(pdate)
}
Sun Aug 3 15:04:07 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Fix typo in annotate output
{
hunk ./darcsweb.cgi 1255
-<i>This is a binary file and it's contents will not be displayed.</i>
+<i>This is a binary file and its contents will not be displayed.</i>
hunk ./darcsweb.cgi 1283
-<i>This is a binary file and it's contents will not be displayed.</i>
+<i>This is a binary file and its contents will not be displayed.</i>
}
Sun Aug 3 15:03:41 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Simplify annotate code
A very simple change, makes the code more straightforward.
{
hunk ./darcsweb.cgi 1053
+ if config.disable_annotate:
+ return None
+
hunk ./darcsweb.cgi 1065
- if not config.disable_annotate:
- out = run_darcs(cmd)
- else:
- return None
- return parse_annotate(out)
+
+ return parse_annotate(run_darcs(cmd))
}
Sun Aug 3 15:02:56 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Fix annotate so it works with darcs 2
darcs 2 doesn't like files beginning with / as parameters for annotate. Since
darcs 1 doesn't care, remove the '/' before running darcs.
hunk ./darcsweb.cgi 1056
+
+ if fname.startswith('/'):
+ # darcs 2 doesn't like files starting with /, and darcs 1
+ # doesn't really care
+ fname = fname[1:]
Sun Aug 3 15:00:34 UTC 2008 Alberto Bertogli <albertito@gmail.com>
* Use _darcs/patches instead of _darcs/inventory
In darcs 2, there is no _darcs/inventory, so use the patches directory to find
out the last modification time of the repository.
Thanks to Patrick Waugh (ptwaugh@gmail.com) for providing (and testing) this
fix.
{
hunk ./darcsweb.cgi 546
- inv = config.repodir + '/_darcs/inventory'
+ inv = config.repodir + '/_darcs/patches'
hunk ./darcsweb.cgi 1934
- inv = config.repodir + '/_darcs/inventory'
+ inv = config.repodir + '/_darcs/patches'
}
Tue Apr 8 00:11:05 UTC 2008 Alberto Bertogli <albertito@gmail.com>
tagged 1.0
{
}