# HG changeset patch # User Thomas Arendsen Hein # Date 2007-01-02 21:40:52 # Node ID a195f11ed1a2563172f5d573986ab4af425f0ffd # Parent 20da40cc1c7331d759a8fd068d0769dc6af0b33d # Parent 769be3c57564bdb99996fecefeaac14bf7f9d425 sync with -stable diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -151,6 +151,22 @@ defaults:: defining command defaults. The command defaults will also be applied to the aliases of the commands defined. +diff:: + Settings used when displaying diffs. They are all boolean and + defaults to False. + git;; + Use git extended diff format. + nodates;; + Don't include dates in diff headers. + showfunc;; + Show which function each change is in. + ignorews;; + Ignore white space when comparing lines. + ignorewsamount;; + Ignore changes in the amount of white space. + ignoreblanklines;; + Ignore changes whose lines are all blank. + email:: Settings for extensions that send email messages. from;; diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -698,7 +698,6 @@ class queue: if saveheads: backupch = repo.changegroupsubset(savebases.keys(), saveheads, 'strip') chgrpfile = bundle(backupch) - chgrpfile = 'file:%s' % chgrpfile stripall(revnum) @@ -707,7 +706,8 @@ class queue: repo.manifest.strip(repo.manifest.rev(change[0]), revnum) if saveheads: self.ui.status("adding branch\n") - commands.unbundle(self.ui, repo, chgrpfile, update=False) + commands.unbundle(self.ui, repo, "file:%s" % chgrpfile, + update=False) if backup != "strip": os.unlink(chgrpfile) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -11,7 +11,7 @@ from i18n import _ import bisect, os, re, sys, signal, imp, urllib, pdb, shlex, stat import fancyopts, ui, hg, util, lock, revlog, bundlerepo import difflib, patch, time, help, mdiff, tempfile -import traceback, errno, version, atexit +import traceback, errno, version, atexit, socket import archival, changegroup, cmdutil, hgweb.server, sshserver class UnknownCommand(Exception): @@ -1337,13 +1337,20 @@ def help_(ui, name=None, with_version=Fa ui.write(d, '\n') ui.status('\n') + + try: + ct = mod.cmdtable + except AttributeError: + ui.status(_('no commands defined\n')) + return + if ui.verbose: ui.status(_('list of commands:\n\n')) else: ui.status(_('list of commands (use "hg help -v %s" ' 'to show aliases and global options):\n\n') % name) - modcmds = dict.fromkeys([c.split('|', 1)[0] for c in mod.cmdtable]) + modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct]) helplist(modcmds.has_key) if name and name != 'shortlist': @@ -1761,7 +1768,7 @@ def manifest(ui, repo, rev=None): ui.write("%s\n" % f) def merge(ui, repo, node=None, force=None): - """Merge working directory with another revision + """merge working directory with another revision Merge the contents of the current working directory and the requested revision. Files that changed between either parent are @@ -2477,7 +2484,7 @@ def unbundle(ui, repo, fname, **opts): return postincoming(ui, repo, modheads, opts['update']) def update(ui, repo, node=None, clean=False, date=None): - """update or merge working directory + """update working directory Update the working directory to the specified revision. @@ -2489,7 +2496,7 @@ def update(ui, repo, node=None, clean=Fa merge command. By default, update will refuse to run if doing so would require - merging or discarding local changes. + discarding local changes. """ if date: if node: @@ -2768,7 +2775,7 @@ table = { ] + walkopts, _('hg log [OPTION]... [FILE]')), "manifest": (manifest, [], _('hg manifest [REV]')), - "merge": + "^merge": (merge, [('f', 'force', None, _('force a merge with outstanding changes'))], _('hg merge [-f] [REV]')), @@ -3230,11 +3237,17 @@ def dispatch(args): u.warn(_("\nbroken pipe\n")) else: raise + except socket.error, inst: + u.warn(_("abort: %s\n") % inst[1]) except IOError, inst: if hasattr(inst, "code"): u.warn(_("abort: %s\n") % inst) elif hasattr(inst, "reason"): - u.warn(_("abort: error: %s\n") % inst.reason[1]) + try: # usually it is in the form (errno, strerror) + reason = inst.reason.args[1] + except: # it might be anything, for example a string + reason = inst.reason + u.warn(_("abort: error: %s\n") % reason) elif hasattr(inst, "args") and inst[0] == errno.EPIPE: if u.debugflag: u.warn(_("broken pipe\n")) diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -6,7 +6,7 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import os, sys, errno, urllib, BaseHTTPServer, socket, SocketServer +import os, sys, errno, urllib, BaseHTTPServer, socket, SocketServer, traceback from mercurial import ui, hg, util, templater from hgweb_mod import hgweb from hgwebdir_mod import hgwebdir @@ -55,10 +55,17 @@ class _hgwebhandler(object, BaseHTTPServ def do_POST(self): try: - self.do_hgweb() - except socket.error, inst: - if inst[0] != errno.EPIPE: - raise + try: + self.do_hgweb() + except socket.error, inst: + if inst[0] != errno.EPIPE: + raise + except StandardError, inst: + self._start_response("500 Internal Server Error", []) + self._write("Internal Server Error") + tb = "".join(traceback.format_exception(*sys.exc_info())) + self.log_error("Exception happened during processing request '%s':\n%s", + self.path, tb) def do_GET(self): self.do_POST() diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -256,15 +256,19 @@ class httprepository(remoterepository): proto = resp.headers['content-type'] # accept old "text/plain" and "application/hg-changegroup" for now - if not proto.startswith('application/mercurial') and \ + if not proto.startswith('application/mercurial-') and \ not proto.startswith('text/plain') and \ not proto.startswith('application/hg-changegroup'): raise hg.RepoError(_("'%s' does not appear to be an hg repository") % self._url) - if proto.startswith('application/mercurial'): - version = proto[22:] - if float(version) > 0.1: + if proto.startswith('application/mercurial-'): + try: + version = float(proto[22:]) + except ValueError: + raise hg.RepoError(_("'%s' sent a broken Content-type " + "header (%s)") % (self._url, proto)) + if version > 0.1: raise hg.RepoError(_("'%s' uses newer protocol %s") % (self._url, version)) diff --git a/tests/test-globalopts.out b/tests/test-globalopts.out --- a/tests/test-globalopts.out +++ b/tests/test-globalopts.out @@ -141,7 +141,7 @@ list of commands (use "hg help -v" to sh locate locate files matching specific patterns log show revision history of entire repository or files manifest output the current or given revision of the project manifest - merge Merge working directory with another revision + merge merge working directory with another revision outgoing show changesets not found in destination parents show the parents of the working dir or revision paths show definition of symbolic path names @@ -160,7 +160,7 @@ list of commands (use "hg help -v" to sh tags list repository tags tip show the tip revision unbundle apply a changegroup file - update update or merge working directory + update update working directory verify verify the integrity of the repository version output version and copyright information Mercurial Distributed SCM @@ -191,7 +191,7 @@ list of commands (use "hg help -v" to sh locate locate files matching specific patterns log show revision history of entire repository or files manifest output the current or given revision of the project manifest - merge Merge working directory with another revision + merge merge working directory with another revision outgoing show changesets not found in destination parents show the parents of the working dir or revision paths show definition of symbolic path names @@ -210,7 +210,7 @@ list of commands (use "hg help -v" to sh tags list repository tags tip show the tip revision unbundle apply a changegroup file - update update or merge working directory + update update working directory verify verify the integrity of the repository version output version and copyright information %% not tested: --debugger diff --git a/tests/test-help.out b/tests/test-help.out --- a/tests/test-help.out +++ b/tests/test-help.out @@ -10,6 +10,7 @@ basic commands (use "hg help" for the fu export dump the header and diffs for one or more changesets init create a new repository in the given directory log show revision history of entire repository or files + merge merge working directory with another revision parents show the parents of the working dir or revision pull pull changes from the specified source push push changes to the specified destination @@ -17,7 +18,7 @@ basic commands (use "hg help" for the fu revert revert files or dirs to their states as of some revision serve export the repository via HTTP status show changed files in the working directory - update update or merge working directory + update update working directory add add the specified files on the next commit annotate show changeset information per file line clone make a copy of an existing repository @@ -26,6 +27,7 @@ basic commands (use "hg help" for the fu export dump the header and diffs for one or more changesets init create a new repository in the given directory log show revision history of entire repository or files + merge merge working directory with another revision parents show the parents of the working dir or revision pull pull changes from the specified source push push changes to the specified destination @@ -33,7 +35,7 @@ basic commands (use "hg help" for the fu revert revert files or dirs to their states as of some revision serve export the repository via HTTP status show changed files in the working directory - update update or merge working directory + update update working directory Mercurial Distributed SCM list of commands (use "hg help -v" to show aliases and global options): @@ -62,7 +64,7 @@ list of commands (use "hg help -v" to sh locate locate files matching specific patterns log show revision history of entire repository or files manifest output the current or given revision of the project manifest - merge Merge working directory with another revision + merge merge working directory with another revision outgoing show changesets not found in destination parents show the parents of the working dir or revision paths show definition of symbolic path names @@ -81,7 +83,7 @@ list of commands (use "hg help -v" to sh tags list repository tags tip show the tip revision unbundle apply a changegroup file - update update or merge working directory + update update working directory verify verify the integrity of the repository version output version and copyright information add add the specified files on the next commit @@ -108,7 +110,7 @@ list of commands (use "hg help -v" to sh locate locate files matching specific patterns log show revision history of entire repository or files manifest output the current or given revision of the project manifest - merge Merge working directory with another revision + merge merge working directory with another revision outgoing show changesets not found in destination parents show the parents of the working dir or revision paths show definition of symbolic path names @@ -127,7 +129,7 @@ list of commands (use "hg help -v" to sh tags list repository tags tip show the tip revision unbundle apply a changegroup file - update update or merge working directory + update update working directory verify verify the integrity of the repository version output version and copyright information hg add [OPTION]... [FILE]... @@ -257,6 +259,7 @@ basic commands (use "hg help" for the fu export dump the header and diffs for one or more changesets init create a new repository in the given directory log show revision history of entire repository or files + merge merge working directory with another revision parents show the parents of the working dir or revision pull pull changes from the specified source push push changes to the specified destination @@ -264,7 +267,7 @@ basic commands (use "hg help" for the fu revert revert files or dirs to their states as of some revision serve export the repository via HTTP status show changed files in the working directory - update update or merge working directory + update update working directory hg: unknown command 'skjdfks' Mercurial Distributed SCM @@ -278,6 +281,7 @@ basic commands (use "hg help" for the fu export dump the header and diffs for one or more changesets init create a new repository in the given directory log show revision history of entire repository or files + merge merge working directory with another revision parents show the parents of the working dir or revision pull pull changes from the specified source push push changes to the specified destination @@ -285,4 +289,4 @@ basic commands (use "hg help" for the fu revert revert files or dirs to their states as of some revision serve export the repository via HTTP status show changed files in the working directory - update update or merge working directory + update update working directory diff --git a/tests/test-notify b/tests/test-notify --- a/tests/test-notify +++ b/tests/test-notify @@ -22,6 +22,7 @@ baseurl = http://test/ foo@bar = * EOF +hg help notify hg init a echo a > a/a echo % commit diff --git a/tests/test-notify.out b/tests/test-notify.out --- a/tests/test-notify.out +++ b/tests/test-notify.out @@ -1,3 +1,6 @@ +notify extension - No help text available + +no commands defined % commit adding a % clone diff --git a/tests/test-strict.out b/tests/test-strict.out --- a/tests/test-strict.out +++ b/tests/test-strict.out @@ -13,6 +13,7 @@ basic commands (use "hg help" for the fu export dump the header and diffs for one or more changesets init create a new repository in the given directory log show revision history of entire repository or files + merge merge working directory with another revision parents show the parents of the working dir or revision pull pull changes from the specified source push push changes to the specified destination @@ -20,7 +21,7 @@ basic commands (use "hg help" for the fu revert revert files or dirs to their states as of some revision serve export the repository via HTTP status show changed files in the working directory - update update or merge working directory + update update working directory 0: a % should succeed - up is an alias, not an abbreviation 0 files updated, 0 files merged, 0 files removed, 0 files unresolved