changeset 7289:ddab62b2fec4

merge with mpm
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 29 Oct 2008 11:39:32 +0100
parents 9c399c53469d (diff) 45495d784ad6 (current diff)
children a3871028aacf
files hgext/rebase.py
diffstat 29 files changed, 54 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/bookmarks.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/bookmarks.py	Wed Oct 29 11:39:32 2008 +0100
@@ -130,13 +130,13 @@
     srev = changelog.rev(node)
     tostrip = [srev]
     saveheads = []
-    for r in xrange(srev, changelog.rev(changelog.tip()) + 1):
+    for r in xrange(srev, len(changelog)):
         parents = changelog.parentrevs(r)
         if parents[0] in tostrip or parents[1] in tostrip:
             tostrip.append(r)
             if parents[1] != nullrev:
                 for p in parents:
-                    if p not in tostrip and p > striprev:
+                    if p not in tostrip and p > srev:
                         saveheads.append(p)
     return [r for r in tostrip if r not in saveheads]
 
@@ -150,7 +150,7 @@
     for mark, n in marks.items():
         if repo.changelog.rev(n) in revisions:
             update.append(mark)
-    result = oldstrip(ui, repo, node, backup)
+    oldstrip(ui, repo, node, backup)
     if len(update) > 0:
         for m in update:
             marks[m] = repo.changectx('.').node()
--- a/hgext/bugzilla.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/bugzilla.py	Wed Oct 29 11:39:32 2008 +0100
@@ -88,7 +88,7 @@
         self.ui.note(_('query: %s %s\n') % (args, kwargs))
         try:
             self.cursor.execute(*args, **kwargs)
-        except MySQLdb.MySQLError, err:
+        except MySQLdb.MySQLError:
             self.ui.note(_('failed query: %s %s\n') % (args, kwargs))
             raise
 
--- a/hgext/convert/cvsps.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/convert/cvsps.py	Wed Oct 29 11:39:32 2008 +0100
@@ -8,7 +8,6 @@
 
 import os
 import re
-import sys
 import cPickle as pickle
 from mercurial import util
 from mercurial.i18n import _
--- a/hgext/graphlog.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/graphlog.py	Wed Oct 29 11:39:32 2008 +0100
@@ -87,7 +87,6 @@
     """
 
     assert start_rev >= stop_rev
-    curr_rev = start_rev
     revs = []
     filerev = len(repo.file(path)) - 1
     while filerev >= 0:
--- a/hgext/inotify/client.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/inotify/client.py	Wed Oct 29 11:39:32 2008 +0100
@@ -9,7 +9,7 @@
 from mercurial.i18n import _
 from mercurial import ui
 import common
-import os, select, socket, stat, struct, sys
+import os, socket, struct
 
 def query(ui, repo, names, match, ignored, clean, unknown=True):
     sock = socket.socket(socket.AF_UNIX)
--- a/hgext/inotify/server.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/inotify/server.py	Wed Oct 29 11:39:32 2008 +0100
@@ -402,7 +402,7 @@
             ret = st.st_mode, st.st_size, st.st_mtime
             self.statcache[wpath] = ret
             return ret
-        except OSError, err:
+        except OSError:
             self.statcache.pop(wpath, None)
             raise
 
@@ -413,7 +413,7 @@
             st = self.stat(wpath)
             if stat.S_ISREG(st[0]):
                 self.updatestatus(wpath, st)
-        except OSError, err:
+        except OSError:
             pass
 
     def modified(self, wpath):
--- a/hgext/mq.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/mq.py	Wed Oct 29 11:39:32 2008 +0100
@@ -185,7 +185,6 @@
         patchguards = self.series_guards[idx]
         if not patchguards:
             return True, None
-        default = False
         guards = self.active()
         exactneg = [g for g in patchguards if g[0] == '-' and g[1:] in guards]
         if exactneg:
@@ -707,7 +706,7 @@
                 except:
                     repo.rollback()
                     raise
-            except Exception, inst:
+            except Exception:
                 patchpath = self.join(patchfn)
                 try:
                     os.unlink(patchpath)
--- a/hgext/purge.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/purge.py	Wed Oct 29 11:39:32 2008 +0100
@@ -65,7 +65,7 @@
         if act:
             try:
                 remove_func(os.path.join(repo.root, name))
-            except OSError, e:
+            except OSError:
                 m = _('%s cannot be removed') % name
                 if opts['abort_on_err']:
                     raise util.Abort(m)
--- a/hgext/rebase.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/rebase.py	Wed Oct 29 11:39:32 2008 +0100
@@ -48,7 +48,7 @@
     If a rebase is interrupted to manually resolve a merge, it can be continued
     with --continue or aborted with --abort.
     """
-    originalwd = target = source = None
+    originalwd = target = None
     external = nullrev
     state = skipped = {}
 
--- a/hgext/transplant.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/transplant.py	Wed Oct 29 11:39:32 2008 +0100
@@ -455,14 +455,6 @@
     If a changeset application fails, you can fix the merge by hand and
     then resume where you left off by calling hg transplant --continue.
     '''
-    def getoneitem(opts, item, errmsg):
-        val = opts.get(item)
-        if val:
-            if len(val) > 1:
-                raise util.Abort(errmsg)
-            else:
-                return val[0]
-
     def getremotechanges(repo, url):
         sourcerepo = ui.expandpath(url)
         source = hg.repository(ui, sourcerepo)
--- a/hgext/zeroconf/__init__.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/hgext/zeroconf/__init__.py	Wed Oct 29 11:39:32 2008 +0100
@@ -82,13 +82,11 @@
 
 class hgwebdirzc(hgwebdir_mod.hgwebdir):
     def run(self):
-        print os.environ
         for r, p in self.repos:
             u = ui.ui(parentui=self.parentui)
-            u.readconfig(os.path.join(path, '.hg', 'hgrc'))
+            u.readconfig(os.path.join(p, '.hg', 'hgrc'))
             n = os.path.basename(r)
-            desc = u.config("web", "description", n)
-            publish(n, "hgweb", p, int(repo.ui.config("web", "port", 8000)))
+            publish(n, "hgweb", p, int(u.config("web", "port", 8000)))
         return super(hgwebdirzc, self).run()
 
 # listen
--- a/mercurial/cmdutil.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/cmdutil.py	Wed Oct 29 11:39:32 2008 +0100
@@ -1154,7 +1154,6 @@
     if pats:
         modified, added, removed = repo.status(match=m)[:3]
         files = util.sort(modified + added + removed)
-        slist = None
 
         def is_dir(f):
             name = f + '/'
--- a/mercurial/commands.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/commands.py	Wed Oct 29 11:39:32 2008 +0100
@@ -11,7 +11,7 @@
 import os, re, sys
 import hg, util, revlog, bundlerepo, extensions, copies
 import difflib, patch, time, help, mdiff, tempfile, url
-import version, socket
+import version
 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
 import merge as merge_
 
--- a/mercurial/dirstate.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/dirstate.py	Wed Oct 29 11:39:32 2008 +0100
@@ -441,7 +441,6 @@
         normalize = self.normalize
         listdir = osutil.listdir
         lstat = os.lstat
-        pconvert = util.pconvert
         getkind = stat.S_IFMT
         dirkind = stat.S_IFDIR
         regkind = stat.S_IFREG
@@ -536,9 +535,6 @@
         lookup, modified, added, unknown, ignored = [], [], [], [], []
         removed, deleted, clean = [], [], []
 
-        _join = self._join
-        lstat = os.lstat
-        cmap = self._copymap
         dmap = self._map
         ladd = lookup.append
         madd = modified.append
--- a/mercurial/dispatch.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/dispatch.py	Wed Oct 29 11:39:32 2008 +0100
@@ -374,7 +374,7 @@
     def checkargs():
         try:
             return cmdfunc()
-        except TypeError, inst:
+        except TypeError:
             # was this an argument error?
             tb = traceback.extract_tb(sys.exc_info()[2])
             if len(tb) != 2: # no
--- a/mercurial/graphmod.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/graphmod.py	Wed Oct 29 11:39:32 2008 +0100
@@ -35,8 +35,6 @@
     new_color = 1
 
     while curr_rev >= stop_rev:
-        node = cl.node(curr_rev)
-
         # Compute revs and next_revs
         if curr_rev not in revs:
             revs.append(curr_rev) # new head
--- a/mercurial/hg.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hg.py	Wed Oct 29 11:39:32 2008 +0100
@@ -256,7 +256,6 @@
 
 def update(repo, node):
     """update the working directory to node, merging linear changes"""
-    pl = repo.parents()
     stats = _merge.update(repo, node, False, False, None)
     _showstats(repo, stats)
     if stats[3]:
@@ -274,7 +273,6 @@
     stats = _merge.update(repo, node, True, force, False)
     _showstats(repo, stats)
     if stats[3]:
-        pl = repo.parents()
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
     elif remind:
         repo.ui.status(_("(branch merge, don't forget to commit)\n"))
--- a/mercurial/hgweb/common.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hgweb/common.py	Wed Oct 29 11:39:32 2008 +0100
@@ -53,12 +53,17 @@
 
     """
     parts = fname.split('/')
-    path = directory
     for part in parts:
         if (part in ('', os.curdir, os.pardir) or
             os.sep in part or os.altsep is not None and os.altsep in part):
             return ""
-        path = os.path.join(path, part)
+    fpath = os.path.join(*parts)
+    if isinstance(directory, str):
+        directory = [directory]
+    for d in directory:
+        path = os.path.join(d, fpath)
+        if os.path.exists(path):
+            break
     try:
         os.stat(path)
         ct = mimetypes.guess_type(path)[0] or "text/plain"
--- a/mercurial/hgweb/hgweb_mod.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Oct 29 11:39:32 2008 +0100
@@ -141,15 +141,16 @@
             else:
                 cmd = ''
 
-            if args and args[0]:
-                node = args.pop(0)
-                req.form['node'] = [node]
-            if args:
-                req.form['file'] = args
+            if cmd == 'static':
+                req.form['file'] = ['/'.join(args)]
+            else:
+                if args and args[0]:
+                    node = args.pop(0)
+                    req.form['node'] = [node]
+                if args:
+                    req.form['file'] = args
 
-            if cmd == 'static':
-                req.form['file'] = req.form['node']
-            elif cmd == 'archive':
+            if cmd == 'archive':
                 fn = req.form['node'][0]
                 for type_, spec in self.archive_specs.iteritems():
                     ext = spec[2]
--- a/mercurial/hgweb/protocol.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hgweb/protocol.py	Wed Oct 29 11:39:32 2008 +0100
@@ -9,7 +9,7 @@
 from mercurial import util, streamclone
 from mercurial.node import bin, hex
 from mercurial import changegroup as changegroupmod
-from common import HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
+from common import ErrorResponse, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 
 # __all__ is populated with the allowed commands. Be sure to add to it if
 # you're adding a new command, or the new command won't work.
--- a/mercurial/hgweb/server.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hgweb/server.py	Wed Oct 29 11:39:32 2008 +0100
@@ -66,7 +66,7 @@
     def do_POST(self):
         try:
             self.do_write()
-        except StandardError, inst:
+        except StandardError:
             self._start_response("500 Internal Server Error", [])
             self._write("Internal Server Error")
             tb = "".join(traceback.format_exception(*sys.exc_info()))
--- a/mercurial/hgweb/webcommands.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hgweb/webcommands.py	Wed Oct 29 11:39:32 2008 +0100
@@ -59,8 +59,6 @@
 def _filerevision(web, tmpl, fctx):
     f = fctx.path()
     text = fctx.data()
-    fl = fctx.filelog()
-    n = fctx.filenode()
     parity = paritygen(web.stripecount)
 
     if binary(text):
@@ -420,7 +418,7 @@
     fctx, ctx = None, None
     try:
         fctx = webutil.filectx(web.repo, req)
-    except LookupError, inst:
+    except LookupError:
         ctx = webutil.changectx(web.repo, req)
         path = webutil.cleanpath(web.repo, req.form['file'][0])
         if path not in ctx.files():
@@ -458,8 +456,6 @@
 def annotate(web, req, tmpl):
     fctx = webutil.filectx(web.repo, req)
     f = fctx.path()
-    n = fctx.filenode()
-    fl = fctx.filelog()
     parity = paritygen(web.stripecount)
 
     def annotate(**map):
@@ -520,7 +516,6 @@
 
         for i in xrange(start, end):
             ctx = fctx.filectx(i)
-            n = fl.node(i)
 
             l.insert(0, {"parity": parity.next(),
                          "filerev": i,
@@ -588,10 +583,7 @@
         tp = web.templatepath
         if isinstance(tp, str):
             tp = [tp]
-        for path in tp:
-            static = os.path.join(path, 'static')
-            if os.path.isdir(static):
-                break
+        static = [os.path.join(p, 'static') for p in tp]
     return [staticfile(static, fname, req)]
 
 def graph(web, req, tmpl):
--- a/mercurial/hook.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/hook.py	Wed Oct 29 11:39:32 2008 +0100
@@ -39,7 +39,7 @@
         try:
             for p in funcname.split('.')[1:]:
                 obj = getattr(obj, p)
-        except AttributeError, err:
+        except AttributeError:
             raise util.Abort(_('%s hook is invalid '
                                '("%s" is not defined)') %
                              (hname, funcname))
--- a/mercurial/httprepo.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/httprepo.py	Wed Oct 29 11:39:32 2008 +0100
@@ -9,7 +9,7 @@
 from node import bin, hex, nullid
 from i18n import _
 import repo, os, urllib, urllib2, urlparse, zlib, util, httplib
-import errno, keepalive, socket, changegroup, statichttprepo
+import errno, socket, changegroup, statichttprepo
 import url
 
 def zgenerator(f):
@@ -17,7 +17,7 @@
     try:
         for chunk in util.filechunkiter(f):
             yield zd.decompress(chunk)
-    except httplib.HTTPException, inst:
+    except httplib.HTTPException:
         raise IOError(None, _('connection ended unexpectedly'))
     yield zd.flush()
 
@@ -215,7 +215,7 @@
 
 class httpsrepository(httprepository):
     def __init__(self, ui, path):
-        if not has_https:
+        if not url.has_https:
             raise util.Abort(_('Python support for SSL and HTTPS '
                                'is not installed'))
         httprepository.__init__(self, ui, path)
--- a/mercurial/simplemerge.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/simplemerge.py	Wed Oct 29 11:39:32 2008 +0100
@@ -432,7 +432,6 @@
     basetext = readfile(base)
     othertext = readfile(other)
 
-    orig = local
     local = os.path.realpath(local)
     if not opts.get('print'):
         opener = util.opener(os.path.dirname(local))
--- a/mercurial/store.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/store.py	Wed Oct 29 11:39:32 2008 +0100
@@ -154,7 +154,6 @@
         '''yields (unencoded, encoded, size)'''
         path = self.pathjoiner(self.path, relpath)
         striplen = len(self.path) + len(os.sep)
-        prefix = path[striplen:]
         l = []
         if os.path.isdir(path):
             visit = [path]
--- a/mercurial/streamclone.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/streamclone.py	Wed Oct 29 11:39:32 2008 +0100
@@ -51,7 +51,7 @@
                 total_bytes += size
         finally:
             del l
-    except (lock.LockHeld, lock.LockUnavailable), inst:
+    except (lock.LockHeld, lock.LockUnavailable):
         raise StreamException(2)
 
     yield '0\n'
--- a/mercurial/url.py	Tue Sep 16 17:51:14 2008 +0200
+++ b/mercurial/url.py	Wed Oct 29 11:39:32 2008 +0100
@@ -250,7 +250,12 @@
     scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
     if not urlpath:
         urlpath = '/'
-    urlpath = quotepath(urlpath)
+    if scheme != 'file':
+        # XXX: why are we quoting the path again with some smart
+        # heuristic here? Anyway, it cannot be done with file://
+        # urls since path encoding is os/fs dependent (see
+        # urllib.pathname2url() for details).
+        urlpath = quotepath(urlpath)
     host, port, user, passwd = netlocsplit(netloc)
 
     # urllib cannot handle URLs with embedded user or passwd
@@ -293,10 +298,17 @@
     opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
     return opener
 
+scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
+
 def open(ui, url, data=None):
-    scheme = urlparse.urlsplit(url)[0]
+    scheme = None
+    m = scheme_re.search(url)
+    if m:
+        scheme = m.group(1).lower()
     if not scheme:
-        url, authinfo = 'file://' + util.normpath(os.path.abspath(url)), None
+        path = util.normpath(os.path.abspath(url))
+        url = 'file://' + urllib.pathname2url(path)
+        authinfo = None
     else:
         url, authinfo = getauthinfo(url)
     return opener(ui, authinfo).open(url, data)
--- a/templates/static/style-coal.css	Tue Sep 16 17:51:14 2008 +0200
+++ b/templates/static/style-coal.css	Wed Oct 29 11:39:32 2008 +0100
@@ -17,10 +17,6 @@
   border-bottom: 15px solid black;
 }
 
-#.main {
-  width:98%;
-}
-
 .overflow {
   width: 100%;
   overflow: auto;
@@ -39,11 +35,6 @@
   right: 27px;
 }
 
-#.menu {
-  position: absolute !important;
-  top:expression(eval(document.body.scrollTop + 27));
-}
-
 .menu ul {
   list-style: none;
   padding: 0;