changeset 9866:e8e9f523ffe8

Merge with i18n
author Matt Mackall <mpm@selenic.com>
date Mon, 16 Nov 2009 12:51:00 -0600
parents 0262bb59016f (diff) 1a2bc8e55396 (current diff)
children c02445cd1b50
files
diffstat 28 files changed, 378 insertions(+), 192 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/convert/subversion.py	Mon Nov 16 12:51:00 2009 -0600
@@ -154,8 +154,9 @@
     except urllib2.HTTPError, inst:
         if inst.code != 404:
             # Except for 404 we cannot know for sure this is not an svn repo
-            ui.warn(_('svn: cannot probe remote repository, assume it could be '
-                      'a subversion repository. Use --source if you know better.\n'))
+            ui.warn(_('svn: cannot probe remote repository, assume it could '
+                      'be a subversion repository. Use --source-type if you '
+                      'know better.\n'))
             return True
         data = inst.fp.read()
     except:
--- a/hgext/inotify/__init__.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/inotify/__init__.py	Mon Nov 16 12:51:00 2009 -0600
@@ -46,7 +46,7 @@
             files = match.files()
             if '.' in files:
                 files = []
-            if self._inotifyon and not ignored:
+            if self._inotifyon and not ignored and not self._dirty:
                 cli = client(ui, repo)
                 try:
                     result = cli.statusquery(files, match, False,
--- a/hgext/inotify/client.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/inotify/client.py	Mon Nov 16 12:51:00 2009 -0600
@@ -150,7 +150,16 @@
                 if names:
                     return filter(match, names.split('\0'))
             return []
-        return map(readnames, resphdr)
+        results = map(readnames, resphdr[:-1])
+
+        if names:
+            nbytes = resphdr[-1]
+            vdirs = cs.read(nbytes)
+            if vdirs:
+                for vdir in vdirs.split('\0'):
+                    match.dir(vdir)
+
+        return results
 
     @start_server
     def debugquery(self):
--- a/hgext/inotify/common.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/inotify/common.py	Mon Nov 16 12:51:00 2009 -0600
@@ -24,16 +24,18 @@
   1) send protocol version number
   2) send query type
   3) send struct.pack'ed headers describing the length of the content:
-      e.g. for STAT, receive 8 integers describing the length of the
-      8 \0-separated string lists ( one list for each lmar!?ic status type )
+      e.g. for STAT, receive 9 integers describing the length of the
+      9 \0-separated string lists to be read:
+       * one file list for each lmar!?ic status type
+       * one list containing the directories visited during lookup
 
 """
 
-version = 2
+version = 3
 
 resphdrfmts = {
-    'STAT': '>llllllll', # status requests
-    'DBUG': '>l'         # debugging queries
+    'STAT': '>lllllllll', # status requests
+    'DBUG': '>l'          # debugging queries
 }
 resphdrsizes = dict((k, struct.calcsize(v))
                     for k, v in resphdrfmts.iteritems())
--- a/hgext/inotify/server.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/inotify/server.py	Mon Nov 16 12:51:00 2009 -0600
@@ -237,7 +237,7 @@
                 ret = d
         return ret
 
-    def walk(self, states):
+    def walk(self, states, visited=None):
         """
         yield (filename, status) pairs for items in the trees
         that have status in states.
@@ -247,10 +247,12 @@
             if st in states:
                 yield join(self.path, file), st
         for dir in self.dirs.itervalues():
+            if visited is not None:
+                visited.add(dir.path)
             for e in dir.walk(states):
                 yield e
 
-    def lookup(self, states, path):
+    def lookup(self, states, path, visited):
         """
         yield root-relative filenames that match path, and whose
         status are in states:
@@ -272,16 +274,20 @@
                 tree = tree.dirs[dir]
         except KeyError:
             # path is not tracked
+            visited.add(tree.path)
             return
 
         try:
             # if path is a directory, walk it
-            for file, st in tree.dirs[last].walk(states):
+            target = tree.dirs[last]
+            visited.add(target.path)
+            for file, st in target.walk(states, visited):
                 yield file
         except KeyError:
             try:
                 if tree.files[last] in states:
                     # path is a file
+                    visited.add(tree.path)
                     yield path
             except KeyError:
                 # path is not tracked
@@ -725,6 +731,7 @@
             # answer.
             self.repowatcher.handle_timeout()
 
+        visited = set()
         if not names:
             def genresult(states, tree):
                 for fn, state in tree.walk(states):
@@ -732,7 +739,7 @@
         else:
             def genresult(states, tree):
                 for fn in names:
-                    for f in tree.lookup(states, fn):
+                    for f in tree.lookup(states, fn, visited):
                         yield f
 
         return ['\0'.join(r) for r in [
@@ -746,6 +753,7 @@
                 or [],
             [],
             'c' in states and genresult('n', self.repowatcher.tree) or [],
+            visited
             ]]
 
     def answer_dbug_query(self):
--- a/hgext/mq.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/hgext/mq.py	Mon Nov 16 12:51:00 2009 -0600
@@ -1129,7 +1129,7 @@
             self.ui.write(_("no patches applied\n"))
             return
         qp = self.qparents(repo, top)
-        if opts.get('inverse'):
+        if opts.get('reverse'):
             node1, node2 = None, qp
         else:
             node1, node2 = qp, None
--- a/mercurial/commands.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/commands.py	Mon Nov 16 12:51:00 2009 -0600
@@ -1099,7 +1099,7 @@
     revs = opts.get('rev')
     change = opts.get('change')
     stat = opts.get('stat')
-    inv = opts.get('inverse')
+    reverse = opts.get('reverse')
 
     if revs and change:
         msg = _('cannot specify --rev and --change at the same time')
@@ -1110,7 +1110,7 @@
     else:
         node1, node2 = cmdutil.revpair(repo, revs)
 
-    if inv:
+    if reverse:
         node1, node2 = node2, node1
 
     if stat:
@@ -3284,7 +3284,7 @@
 
 diffopts2 = [
     ('p', 'show-function', None, _('show which function each change is in')),
-    ('', 'inverse', None, _('produce a diff that undoes the changes')),
+    ('', 'reverse', None, _('produce a diff that undoes the changes')),
     ('w', 'ignore-all-space', None,
      _('ignore white space when comparing lines')),
     ('b', 'ignore-space-change', None,
--- a/mercurial/hook.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/hook.py	Mon Nov 16 12:51:00 2009 -0600
@@ -37,10 +37,18 @@
         try:
             obj = __import__(modname)
         except ImportError:
+            e1 = sys.exc_type, sys.exc_value, sys.exc_traceback
             try:
                 # extensions are loaded with hgext_ prefix
                 obj = __import__("hgext_%s" % modname)
             except ImportError:
+                e2 = sys.exc_type, sys.exc_value, sys.exc_traceback
+                if ui.tracebackflag:
+                    ui.warn(_('exception from first failed import attempt:\n'))
+                ui.traceback(e1)
+                if ui.tracebackflag:
+                    ui.warn(_('exception from second failed import attempt:\n'))
+                ui.traceback(e2)
                 raise util.Abort(_('%s hook is invalid '
                                    '(import of "%s" failed)') %
                                  (hname, modname))
--- a/mercurial/httprepo.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/httprepo.py	Mon Nov 16 12:51:00 2009 -0600
@@ -11,6 +11,7 @@
 import repo, changegroup, statichttprepo, error, url, util
 import os, urllib, urllib2, urlparse, zlib, httplib
 import errno, socket
+import encoding
 
 def zgenerator(f):
     zd = zlib.decompressobj()
@@ -153,6 +154,10 @@
             for branchpart in d.splitlines():
                 branchheads = branchpart.split(' ')
                 branchname = urllib.unquote(branchheads[0])
+                try:
+                    branchname.decode('utf-8', 'strict')
+                except UnicodeDecodeError:
+                    branchname = encoding.tolocal(branchname)
                 branchheads = [bin(x) for x in branchheads[1:]]
                 branchmap[branchname] = branchheads
             return branchmap
--- a/mercurial/lock.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/lock.py	Mon Nov 16 12:51:00 2009 -0600
@@ -112,8 +112,7 @@
         # if locker dead, break lock.  must do this with another lock
         # held, or can race and break valid lock.
         try:
-            l = lock(self.f + '.break')
-            l.trylock()
+            l = lock(self.f + '.break', timeout=0)
             os.unlink(self.f)
             l.release()
         except error.LockError:
--- a/mercurial/sshrepo.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/sshrepo.py	Mon Nov 16 12:51:00 2009 -0600
@@ -7,7 +7,7 @@
 
 from node import bin, hex
 from i18n import _
-import repo, util, error
+import repo, util, error, encoding
 import re, urllib
 
 class remotelock(object):
@@ -173,6 +173,10 @@
             for branchpart in d.splitlines():
                 branchheads = branchpart.split(' ')
                 branchname = urllib.unquote(branchheads[0])
+                try:
+                    branchname.decode('utf-8', 'strict')
+                except UnicodeDecodeError:
+                    branchname = encoding.tolocal(branchname)
                 branchheads = [bin(x) for x in branchheads[1:]]
                 branchmap[branchname] = branchheads
             return branchmap
--- a/mercurial/ui.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/ui.py	Mon Nov 16 12:51:00 2009 -0600
@@ -15,7 +15,7 @@
 class ui(object):
     def __init__(self, src=None):
         self._buffers = []
-        self.quiet = self.verbose = self.debugflag = self._traceback = False
+        self.quiet = self.verbose = self.debugflag = self.tracebackflag = False
         self._reportuntrusted = True
         self._ocfg = config.config() # overlay
         self._tcfg = config.config() # trusted
@@ -101,7 +101,7 @@
         if self.verbose and self.quiet:
             self.quiet = self.verbose = False
         self._reportuntrusted = self.configbool("ui", "report_untrusted", True)
-        self._traceback = self.configbool('ui', 'traceback', False)
+        self.tracebackflag = self.configbool('ui', 'traceback', False)
 
         # update trust information
         self._trustusers.update(self.configlist('trusted', 'users'))
@@ -337,13 +337,16 @@
 
         return t
 
-    def traceback(self):
+    def traceback(self, exc=None):
         '''print exception traceback if traceback printing enabled.
         only to call in exception handler. returns true if traceback
         printed.'''
-        if self._traceback:
-            traceback.print_exc()
-        return self._traceback
+        if self.tracebackflag:
+            if exc:
+                traceback.print_exception(exc[0], exc[1], exc[2])
+            else:
+                traceback.print_exc()
+        return self.tracebackflag
 
     def geteditor(self):
         '''return editor to use'''
--- a/mercurial/url.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/mercurial/url.py	Mon Nov 16 12:51:00 2009 -0600
@@ -262,108 +262,11 @@
     # must be able to send big bundle as stream.
     send = _gen_sendfile(keepalive.HTTPConnection)
 
-    def _proxytunnel(self):
-        proxyheaders = dict(
-                [(x, self.headers[x]) for x in self.headers
-                 if x.lower().startswith('proxy-')])
-        self._set_hostport(self.host, self.port)
-        self.send('CONNECT %s:%d HTTP/1.0\r\n' % (self.realhost, self.realport))
-        for header in proxyheaders.iteritems():
-            self.send('%s: %s\r\n' % header)
-        self.send('\r\n')
-
-        # majority of the following code is duplicated from
-        # httplib.HTTPConnection as there are no adequate places to
-        # override functions to provide the needed functionality
-        res = self.response_class(self.sock,
-                                  strict=self.strict,
-                                  method=self._method)
-
-        while True:
-            version, status, reason = res._read_status()
-            if status != httplib.CONTINUE:
-                break
-            while True:
-                skip = res.fp.readline().strip()
-                if not skip:
-                    break
-        res.status = status
-        res.reason = reason.strip()
-
-        if res.status == 200:
-            while True:
-                line = res.fp.readline()
-                if line == '\r\n':
-                    break
-            return True
-
-        if version == 'HTTP/1.0':
-            res.version = 10
-        elif version.startswith('HTTP/1.'):
-            res.version = 11
-        elif version == 'HTTP/0.9':
-            res.version = 9
-        else:
-            raise httplib.UnknownProtocol(version)
-
-        if res.version == 9:
-            res.length = None
-            res.chunked = 0
-            res.will_close = 1
-            res.msg = httplib.HTTPMessage(cStringIO.StringIO())
-            return False
-
-        res.msg = httplib.HTTPMessage(res.fp)
-        res.msg.fp = None
-
-        # are we using the chunked-style of transfer encoding?
-        trenc = res.msg.getheader('transfer-encoding')
-        if trenc and trenc.lower() == "chunked":
-            res.chunked = 1
-            res.chunk_left = None
-        else:
-            res.chunked = 0
-
-        # will the connection close at the end of the response?
-        res.will_close = res._check_close()
-
-        # do we have a Content-Length?
-        # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
-        length = res.msg.getheader('content-length')
-        if length and not res.chunked:
-            try:
-                res.length = int(length)
-            except ValueError:
-                res.length = None
-            else:
-                if res.length < 0:  # ignore nonsensical negative lengths
-                    res.length = None
-        else:
-            res.length = None
-
-        # does the body have a fixed length? (of zero)
-        if (status == httplib.NO_CONTENT or status == httplib.NOT_MODIFIED or
-            100 <= status < 200 or # 1xx codes
-            res._method == 'HEAD'):
-            res.length = 0
-
-        # if the connection remains open, and we aren't using chunked, and
-        # a content-length was not provided, then assume that the connection
-        # WILL close.
-        if (not res.will_close and
-           not res.chunked and
-           res.length is None):
-            res.will_close = 1
-
-        self.proxyres = res
-
-        return False
-
     def connect(self):
         if has_https and self.realhost: # use CONNECT proxy
             self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             self.sock.connect((self.host, self.port))
-            if self._proxytunnel():
+            if _generic_proxytunnel(self):
                 # we do not support client x509 certificates
                 self.sock = _ssl_wrap_socket(self.sock, None, None)
         else:
@@ -378,30 +281,141 @@
             return proxyres
         return keepalive.HTTPConnection.getresponse(self)
 
+# general transaction handler to support different ways to handle
+# HTTPS proxying before and after Python 2.6.3.
+def _generic_start_transaction(handler, h, req):
+    if hasattr(req, '_tunnel_host') and req._tunnel_host:
+        tunnel_host = req._tunnel_host
+        if tunnel_host[:7] not in ['http://', 'https:/']:
+            tunnel_host = 'https://' + tunnel_host
+        new_tunnel = True
+    else:
+        tunnel_host = req.get_selector()
+        new_tunnel = False
+
+    if new_tunnel or tunnel_host == req.get_full_url(): # has proxy
+        urlparts = urlparse.urlparse(tunnel_host)
+        if new_tunnel or urlparts[0] == 'https': # only use CONNECT for HTTPS
+            if ':' in urlparts[1]:
+                realhost, realport = urlparts[1].split(':')
+                realport = int(realport)
+            else:
+                realhost = urlparts[1]
+                realport = 443
+
+            h.realhost = realhost
+            h.realport = realport
+            h.headers = req.headers.copy()
+            h.headers.update(handler.parent.addheaders)
+            return
+
+    h.realhost = None
+    h.realport = None
+    h.headers = None
+
+def _generic_proxytunnel(self):
+    proxyheaders = dict(
+            [(x, self.headers[x]) for x in self.headers
+             if x.lower().startswith('proxy-')])
+    self._set_hostport(self.host, self.port)
+    self.send('CONNECT %s:%d HTTP/1.0\r\n' % (self.realhost, self.realport))
+    for header in proxyheaders.iteritems():
+        self.send('%s: %s\r\n' % header)
+    self.send('\r\n')
+
+    # majority of the following code is duplicated from
+    # httplib.HTTPConnection as there are no adequate places to
+    # override functions to provide the needed functionality
+    res = self.response_class(self.sock,
+                              strict=self.strict,
+                              method=self._method)
+
+    while True:
+        version, status, reason = res._read_status()
+        if status != httplib.CONTINUE:
+            break
+        while True:
+            skip = res.fp.readline().strip()
+            if not skip:
+                break
+    res.status = status
+    res.reason = reason.strip()
+
+    if res.status == 200:
+        while True:
+            line = res.fp.readline()
+            if line == '\r\n':
+                break
+        return True
+
+    if version == 'HTTP/1.0':
+        res.version = 10
+    elif version.startswith('HTTP/1.'):
+        res.version = 11
+    elif version == 'HTTP/0.9':
+        res.version = 9
+    else:
+        raise httplib.UnknownProtocol(version)
+
+    if res.version == 9:
+        res.length = None
+        res.chunked = 0
+        res.will_close = 1
+        res.msg = httplib.HTTPMessage(cStringIO.StringIO())
+        return False
+
+    res.msg = httplib.HTTPMessage(res.fp)
+    res.msg.fp = None
+
+    # are we using the chunked-style of transfer encoding?
+    trenc = res.msg.getheader('transfer-encoding')
+    if trenc and trenc.lower() == "chunked":
+        res.chunked = 1
+        res.chunk_left = None
+    else:
+        res.chunked = 0
+
+    # will the connection close at the end of the response?
+    res.will_close = res._check_close()
+
+    # do we have a Content-Length?
+    # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
+    length = res.msg.getheader('content-length')
+    if length and not res.chunked:
+        try:
+            res.length = int(length)
+        except ValueError:
+            res.length = None
+        else:
+            if res.length < 0:  # ignore nonsensical negative lengths
+                res.length = None
+    else:
+        res.length = None
+
+    # does the body have a fixed length? (of zero)
+    if (status == httplib.NO_CONTENT or status == httplib.NOT_MODIFIED or
+        100 <= status < 200 or # 1xx codes
+        res._method == 'HEAD'):
+        res.length = 0
+
+    # if the connection remains open, and we aren't using chunked, and
+    # a content-length was not provided, then assume that the connection
+    # WILL close.
+    if (not res.will_close and
+       not res.chunked and
+       res.length is None):
+        res.will_close = 1
+
+    self.proxyres = res
+
+    return False
+
 class httphandler(keepalive.HTTPHandler):
     def http_open(self, req):
         return self.do_open(httpconnection, req)
 
     def _start_transaction(self, h, req):
-        if req.get_selector() == req.get_full_url(): # has proxy
-            urlparts = urlparse.urlparse(req.get_selector())
-            if urlparts[0] == 'https': # only use CONNECT for HTTPS
-                if ':' in urlparts[1]:
-                    realhost, realport = urlparts[1].split(':')
-                    realport = int(realport)
-                else:
-                    realhost = urlparts[1]
-                    realport = 443
-
-                h.realhost = realhost
-                h.realport = realport
-                h.headers = req.headers.copy()
-                h.headers.update(self.parent.addheaders)
-                return keepalive.HTTPHandler._start_transaction(self, h, req)
-
-        h.realhost = None
-        h.realport = None
-        h.headers = None
+        _generic_start_transaction(self, h, req)
         return keepalive.HTTPHandler._start_transaction(self, h, req)
 
     def __del__(self):
@@ -417,6 +431,15 @@
         send = _gen_sendfile(BetterHTTPS)
         getresponse = keepalive.wrapgetresponse(httplib.HTTPSConnection)
 
+        def connect(self):
+            if self.realhost: # use CONNECT proxy
+                self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+                self.sock.connect((self.host, self.port))
+                if _generic_proxytunnel(self):
+                    self.sock = _ssl_wrap_socket(self.sock, self.cert_file, self.key_file)
+            else:
+                BetterHTTPS.connect(self)
+
     class httpshandler(keepalive.KeepAliveHandler, urllib2.HTTPSHandler):
         def __init__(self, ui):
             keepalive.KeepAliveHandler.__init__(self)
@@ -424,6 +447,10 @@
             self.ui = ui
             self.pwmgr = passwordmgr(self.ui)
 
+        def _start_transaction(self, h, req):
+            _generic_start_transaction(self, h, req)
+            return keepalive.KeepAliveHandler._start_transaction(self, h, req)
+
         def https_open(self, req):
             self.auth = self.pwmgr.readauthtoken(req.get_full_url())
             return self.do_open(self._makeconnection, req)
--- a/setup.py	Mon Nov 16 14:37:31 2009 -0200
+++ b/setup.py	Mon Nov 16 12:51:00 2009 -0600
@@ -121,6 +121,8 @@
     env = {'PYTHONPATH': os.pathsep.join(pypath),
            'HGRCPATH': '',
            'LANGUAGE': 'C'}
+    if 'LD_LIBRARY_PATH' in os.environ:
+        env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
     if 'SystemRoot' in os.environ:
         # Copy SystemRoot into the custom environment for Python 2.6
         # under Windows. Otherwise, the subprocess will fail with
--- a/tests/test-debugcomplete.out	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-debugcomplete.out	Mon Nov 16 12:51:00 2009 -0600
@@ -167,7 +167,7 @@
 annotate: rev, follow, text, user, date, number, changeset, line-number, include, exclude
 clone: noupdate, updaterev, rev, pull, uncompressed, ssh, remotecmd
 commit: addremove, close-branch, include, exclude, message, logfile, date, user
-diff: rev, change, text, git, nodates, show-function, inverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
+diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
 export: output, switch-parent, text, git, nodates
 forget: include, exclude
 init: ssh, remotecmd
--- a/tests/test-diff-inverse	Mon Nov 16 14:37:31 2009 -0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-cat > a <<EOF
-a
-b
-c
-EOF
-hg ci -Am adda
-
-cat > a <<EOF
-d
-e
-f
-EOF
-hg ci -m moda
-
-hg diff --inverse -r0 -r1
-
-cat >> a <<EOF
-g
-h
-EOF
-hg diff --inverse --nodates
--- a/tests/test-diff-inverse.out	Mon Nov 16 14:37:31 2009 -0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-adding a
-diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,3 +1,3 @@
--d
--e
--f
-+a
-+b
-+c
-diff -r 2855cdcfcbb7 a
---- a/a
-+++ b/a
-@@ -1,5 +1,3 @@
- d
- e
- f
--g
--h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse	Mon Nov 16 12:51:00 2009 -0600
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+hg init
+cat > a <<EOF
+a
+b
+c
+EOF
+hg ci -Am adda
+
+cat > a <<EOF
+d
+e
+f
+EOF
+hg ci -m moda
+
+hg diff --reverse -r0 -r1
+
+cat >> a <<EOF
+g
+h
+EOF
+hg diff --reverse --nodates
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse.out	Mon Nov 16 12:51:00 2009 -0600
@@ -0,0 +1,20 @@
+adding a
+diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -1,3 +1,3 @@
+-d
+-e
+-f
++a
++b
++c
+diff -r 2855cdcfcbb7 a
+--- a/a
++++ b/a
+@@ -1,5 +1,3 @@
+ d
+ e
+ f
+-g
+-h
--- a/tests/test-help.out	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-help.out	Mon Nov 16 12:51:00 2009 -0600
@@ -239,7 +239,7 @@
  -g --git                  use git extended diff format
     --nodates              don't include dates in diff headers
  -p --show-function        show which function each change is in
-    --inverse              produce a diff that undoes the changes
+    --reverse              produce a diff that undoes the changes
  -w --ignore-all-space     ignore white space when comparing lines
  -b --ignore-space-change  ignore changes in the amount of white space
  -B --ignore-blank-lines   ignore changes whose lines are all blank
--- a/tests/test-hook	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-hook	Mon Nov 16 12:51:00 2009 -0600
@@ -248,4 +248,18 @@
 cd ../repo
 hg commit
 
+cd ../../b
+echo '# make sure --traceback works on hook import failure'
+cat > importfail.py <<EOF
+import somebogusmodule
+# dereference something in the module to force demandimport to load it
+somebogusmodule.whatever
+EOF
+
+echo '[hooks]' > .hg/hgrc
+echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
+
+echo a >> a
+hg --traceback commit -Ama 2>&1 | grep '^\(exception\|Traceback\|ImportError\)'
+
 exit 0
--- a/tests/test-hook.out	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-hook.out	Mon Nov 16 12:51:00 2009 -0600
@@ -163,3 +163,11 @@
 # test python hook configured with python:[file]:[hook] syntax
 hook works
 nothing changed
+# make sure --traceback works on hook import failure
+exception from first failed import attempt:
+Traceback (most recent call last):
+ImportError: No module named somebogusmodule
+exception from second failed import attempt:
+Traceback (most recent call last):
+ImportError: No module named hgext_importfail
+Traceback (most recent call last):
--- a/tests/test-inotify	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-inotify	Mon Nov 16 12:51:00 2009 -0600
@@ -70,4 +70,14 @@
 
 HGMERGE=internal:local hg up
 hg st
+
+# Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
+mkdir 1844
+echo a > 1844/foo
+hg add 1844
+hg ci -m 'working'
+
+echo b >> 1844/foo
+hg ci 1844 -m 'broken'
+
 kill `cat hg.pid`
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-dirty-dirstate	Mon Nov 16 12:51:00 2009 -0600
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# issues when status queries are issued when dirstate is dirty
+
+"$TESTDIR/hghave" inotify || exit 80
+
+echo "[extensions]" >> $HGRCPATH
+echo "inotify=" >> $HGRCPATH
+echo "fetch=" >> $HGRCPATH
+
+echo % issue1810: inotify and fetch
+mkdir test; cd test
+hg init
+hg inserve -d --pid-file=../hg.pid
+cat ../hg.pid >> "$DAEMON_PIDS"
+
+echo foo > foo
+hg add
+hg ci -m foo
+
+cd ..
+
+hg --config "extensions.inotify=!" clone test test2
+cd test2
+hg inserve -d --pid-file=../hg2.pid
+cat ../hg2.pid >> "$DAEMON_PIDS"
+echo bar > bar
+hg add
+hg ci -m bar
+cd ../test
+echo spam > spam
+hg add
+hg ci -m spam
+cd ../test2
+hg st
+
+# abort, outstanding changes
+hg fetch -q
+hg st
+cd ..
+
+
+echo % issue1719: inotify and mq
+
+echo "mq=" >> $HGRCPATH
+
+hg init test-1719
+cd test-1719
+
+echo % inserve
+hg inserve -d --pid-file=../hg-test-1719.pid
+cat ../hg-test-1719.pid >> "$DAEMON_PIDS"
+
+echo content > file
+hg add file
+
+hg qnew -f test.patch
+
+hg status
+hg qpop
+
+echo % st should not output anything
+hg status
+
+hg qpush
+
+echo % st should not output anything
+hg status
+
+hg qrefresh
+hg status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-dirty-dirstate.out	Mon Nov 16 12:51:00 2009 -0600
@@ -0,0 +1,14 @@
+% issue1810: inotify and fetch
+adding foo
+updating to branch default
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding bar
+adding spam
+% issue1719: inotify and mq
+% inserve
+popping test.patch
+patch queue now empty
+% st should not output anything
+applying test.patch
+now at: test.patch
+% st should not output anything
--- a/tests/test-inotify.out	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-inotify.out	Mon Nov 16 12:51:00 2009 -0600
@@ -44,3 +44,4 @@
 M a
 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
 M a
+adding 1844/foo
--- a/tests/test-mq-qdiff	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-mq-qdiff	Mon Nov 16 12:51:00 2009 -0600
@@ -58,5 +58,5 @@
 echo % qdiff -w
 hg qdiff --nodates -w
 
-echo % qdiff --inverse
-hg qdiff --nodates --inverse
+echo % qdiff --reverse
+hg qdiff --nodates --reverse
--- a/tests/test-mq-qdiff.out	Mon Nov 16 14:37:31 2009 -0200
+++ b/tests/test-mq-qdiff.out	Mon Nov 16 12:51:00 2009 -0600
@@ -85,7 +85,7 @@
  1
  2
  3
-% qdiff --inverse
+% qdiff --reverse
 diff -r 35fb829491c1 lines
 --- a/lines
 +++ b/lines