changeset 9909:369592fdc2e4

Merge with i18n
author Matt Mackall <mpm@selenic.com>
date Sun, 22 Nov 2009 15:36:22 -0600
parents 95517eb3c9a7 (diff) 2b6e40fdc615 (current diff)
children 1746909b8878 f0f7994d2230
files
diffstat 8 files changed, 48 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/inotify/client.py	Sun Nov 22 21:34:12 2009 +0100
+++ b/hgext/inotify/client.py	Sun Nov 22 15:36:22 2009 -0600
@@ -27,8 +27,8 @@
             autostart = self.ui.configbool('inotify', 'autostart', True)
 
             if err[0] == errno.ECONNREFUSED:
-                self.ui.warn(_('(found dead inotify server socket; '
-                               'removing it)\n'))
+                self.ui.warn(_('inotify-client: found dead inotify server '
+                               'socket; removing it\n'))
                 os.unlink(os.path.join(self.root, '.hg', 'inotify.sock'))
             if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
                 self.ui.debug('(starting inotify server)\n')
@@ -41,20 +41,20 @@
                         # inotify server while this one was starting.
                         self.ui.debug(str(inst))
                 except Exception, inst:
-                    self.ui.warn(_('could not start inotify server: '
-                                   '%s\n') % inst)
+                    self.ui.warn(_('inotify-client: could not start inotify '
+                                   'server: %s\n') % inst)
                 else:
                     try:
                         return function(self, *args)
                     except socket.error, err:
-                        self.ui.warn(_('could not talk to new inotify '
-                                       'server: %s\n') % err[-1])
+                        self.ui.warn(_('inotify-client: could not talk to new '
+                                       'inotify server: %s\n') % err[-1])
             elif err[0] in (errno.ECONNREFUSED, errno.ENOENT):
                 # silently ignore normal errors if autostart is False
                 self.ui.debug('(inotify server not running)\n')
             else:
-                self.ui.warn(_('failed to contact inotify server: %s\n')
-                         % err[-1])
+                self.ui.warn(_('inotify-client: failed to contact inotify '
+                               'server: %s\n') % err[-1])
 
         self.ui.traceback()
         raise QueryFailed('inotify query failed')
@@ -97,7 +97,8 @@
             version = ord(cs.read(1))
         except TypeError:
             # empty answer, assume the server crashed
-            self.ui.warn(_('received empty answer from inotify server'))
+            self.ui.warn(_('inotify-client: received empty answer from inotify '
+                           'server'))
             raise QueryFailed('server crashed')
 
         if version != common.version:
--- a/hgext/inotify/server.py	Sun Nov 22 21:34:12 2009 +0100
+++ b/hgext/inotify/server.py	Sun Nov 22 15:36:22 2009 -0600
@@ -691,9 +691,13 @@
             self.sock.bind(self.sockpath)
         except socket.error, err:
             if err[0] == errno.EADDRINUSE:
-                raise AlreadyStartedException(_('could not start server: %s')
-                                              % err[1])
+                raise AlreadyStartedException( _('cannot start: socket is '
+                                                 'already bound'))
             if err[0] == "AF_UNIX path too long":
+                if os.path.islink(self.sockpath) and \
+                        not os.path.exists(self.sockpath):
+                    raise util.Abort('inotify-server: cannot start: '
+                                    '.hg/inotify.sock is a broken symlink')
                 tempdir = tempfile.mkdtemp(prefix="hg-inotify-")
                 self.realsockpath = os.path.join(tempdir, "inotify.sock")
                 try:
@@ -706,8 +710,9 @@
                         pass
                     os.rmdir(tempdir)
                     if inst.errno == errno.EEXIST:
-                        raise AlreadyStartedException(_('could not start server: %s')
-                                                      % inst.strerror)
+                        raise AlreadyStartedException(_('cannot start: tried '
+                            'linking .hg/inotify.sock to a temporary socket but'
+                            ' .hg/inotify.sock already exists'))
                     raise
             else:
                 raise
@@ -841,7 +846,7 @@
             try:
                 self.master = master(ui, dirstate, root, timeout)
             except AlreadyStartedException, inst:
-                raise util.Abort(str(inst))
+                raise util.Abort("inotify-server: %s" % inst)
 
         def run(self):
             try:
--- a/mercurial/commands.py	Sun Nov 22 21:34:12 2009 +0100
+++ b/mercurial/commands.py	Sun Nov 22 15:36:22 2009 -0600
@@ -1476,7 +1476,7 @@
             ui.write('\n')
 
         try:
-            aliases, i = cmdutil.findcmd(name, table, False)
+            aliases, entry = cmdutil.findcmd(name, table, False)
         except error.AmbiguousCommand, inst:
             # py3k fix: except vars can't be used outside the scope of the
             # except block, nor can be used inside a lambda. python issue4617
@@ -1486,11 +1486,11 @@
             return
 
         # synopsis
-        if len(i) > 2:
-            if i[2].startswith('hg'):
-                ui.write("%s\n" % i[2])
+        if len(entry) > 2:
+            if entry[2].startswith('hg'):
+                ui.write("%s\n" % entry[2])
             else:
-                ui.write('hg %s %s\n' % (aliases[0], i[2]))
+                ui.write('hg %s %s\n' % (aliases[0], entry[2]))
         else:
             ui.write('hg %s\n' % aliases[0])
 
@@ -1499,7 +1499,7 @@
             ui.write(_("\naliases: %s\n") % ', '.join(aliases[1:]))
 
         # description
-        doc = gettext(i[0].__doc__)
+        doc = gettext(entry[0].__doc__)
         if not doc:
             doc = _("(no help text available)")
         if ui.quiet:
@@ -1508,8 +1508,8 @@
 
         if not ui.quiet:
             # options
-            if i[1]:
-                option_lists.append((_("options:\n"), i[1]))
+            if entry[1]:
+                option_lists.append((_("options:\n"), entry[1]))
 
             addglobalopts(False)
 
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 22 21:34:12 2009 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 22 15:36:22 2009 -0600
@@ -48,6 +48,7 @@
         self.conf = conf
         self.baseui = baseui
         self.lastrefresh = 0
+        self.motd = None
         self.refresh()
 
     def refresh(self):
@@ -72,7 +73,6 @@
 
         encoding.encoding = self.ui.config('web', 'encoding',
                                            encoding.encoding)
-        self.motd = self.ui.config('web', 'motd')
         self.style = self.ui.config('web', 'style', 'paper')
         self.stripecount = self.ui.config('web', 'stripes', 1)
         if self.stripecount:
--- a/tests/run-tests.py	Sun Nov 22 21:34:12 2009 +0100
+++ b/tests/run-tests.py	Sun Nov 22 15:36:22 2009 -0600
@@ -293,10 +293,18 @@
     script = os.path.realpath(sys.argv[0])
     hgroot = os.path.dirname(os.path.dirname(script))
     os.chdir(hgroot)
+    nohome = '--home=""'
+    if os.name == 'nt':
+        # The --home="" trick works only on OS where os.sep == '/'
+        # because of a distutils convert_path() fast-path. Avoid it at
+        # least on Windows for now, deal with .pydistutils.cfg bugs
+        # when they happen.
+        nohome = ''
     cmd = ('%s setup.py %s clean --all'
            ' install --force --prefix="%s" --install-lib="%s"'
-           ' --install-scripts="%s" --home="" >%s 2>&1'
-           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, installerrs))
+           ' --install-scripts="%s" %s >%s 2>&1'
+           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, nohome,
+              installerrs))
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not options.verbose:
--- a/tests/test-inotify	Sun Nov 22 21:34:12 2009 +0100
+++ b/tests/test-inotify	Sun Nov 22 15:36:22 2009 -0600
@@ -33,6 +33,10 @@
 
 # let the daemon finish its stuff
 sleep 1
+
+echo % cannot start, already bound
+hg inserve
+
 # issue907
 hg status
 echo % clean
--- a/tests/test-inotify-issue1208.out	Sun Nov 22 21:34:12 2009 +0100
+++ b/tests/test-inotify-issue1208.out	Sun Nov 22 15:36:22 2009 -0600
@@ -1,7 +1,7 @@
 % fail
-abort: could not start server: File exists
-could not talk to new inotify server: No such file or directory
-abort: could not start server: File exists
+abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
+inotify-client: could not talk to new inotify server: No such file or directory
+abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
 % inserve
 % status
 ? hg.pid
--- a/tests/test-inotify.out	Sun Nov 22 21:34:12 2009 +0100
+++ b/tests/test-inotify.out	Sun Nov 22 15:36:22 2009 -0600
@@ -10,6 +10,8 @@
 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
 M a
 % inserve
+% cannot start, already bound
+abort: inotify-server: cannot start: socket is already bound
 ? hg.pid
 % clean
 C a