diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -79,16 +79,16 @@ test-%: update-pot: i18n/hg.pot -i18n/hg.pot: $(PYTHON_FILES) +i18n/hg.pot: $(PYTHON_FILES) help/*.txt $(PYTHON) i18n/hggettext mercurial/commands.py \ - hgext/*.py hgext/*/__init__.py > i18n/hg.pot + hgext/*.py hgext/*/__init__.py help/*.txt > i18n/hg.pot # All strings marked for translation in Mercurial contain # ASCII characters only. But some files contain string # literals like this '\037\213'. xgettext thinks it has to # parse them even though they are not marked for translation. # Extracting with an explicit encoding of ISO-8859-1 will make # xgettext "parse" and ignore them. - echo $^ | xargs \ + echo $(PYTHON_FILES) | xargs \ xgettext --package-name "Mercurial" \ --msgid-bugs-address "" \ --copyright-holder "Matt Mackall and others" \ diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -546,3 +546,20 @@ complete -o bashdefault -o default -F _h return } +# shelve +_hg_shelves() +{ + local shelves="$("$hg" unshelve -l . 2>/dev/null)" + local IFS=$'\n' + COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$shelves' -- "$cur")) +} + +_hg_cmd_shelve() +{ + _hg_status "mard" +} + +_hg_cmd_unshelve() +{ + _hg_shelves +} diff --git a/contrib/shrink-revlog.py b/contrib/shrink-revlog.py new file mode 100755 --- /dev/null +++ b/contrib/shrink-revlog.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python + +"""\ +Reorder a revlog (by default the the manifest file in the current +repository) to save space. Specifically, this topologically sorts the +revisions in the revlog so that revisions on the same branch are adjacent +as much as possible. This is a workaround for the fact that Mercurial +computes deltas relative to the previous revision rather than relative to a +parent revision. This is *not* safe to run on a changelog. +""" + +# Originally written by Benoit Boissinot +# as a patch to rewrite-log. Cleaned up, refactored, documented, and +# renamed by Greg Ward . + +# XXX would be nice to have a way to verify the repository after shrinking, +# e.g. by comparing "before" and "after" states of random changesets +# (maybe: export before, shrink, export after, diff). + +import sys, os, tempfile +import optparse +from mercurial import ui as ui_, hg, revlog, transaction, node, util + +def toposort(rl): + write = sys.stdout.write + + children = {} + root = [] + # build children and roots + write('reading %d revs ' % len(rl)) + try: + for i in rl: + children[i] = [] + parents = [p for p in rl.parentrevs(i) if p != node.nullrev] + # in case of duplicate parents + if len(parents) == 2 and parents[0] == parents[1]: + del parents[1] + for p in parents: + assert p in children + children[p].append(i) + + if len(parents) == 0: + root.append(i) + + if i % 1000 == 0: + write('.') + finally: + write('\n') + + # XXX this is a reimplementation of the 'branchsort' topo sort + # algorithm in hgext.convert.convcmd... would be nice not to duplicate + # the algorithm + write('sorting ...') + visit = root + ret = [] + while visit: + i = visit.pop(0) + ret.append(i) + if i not in children: + # This only happens if some node's p1 == p2, which can + # happen in the manifest in certain circumstances. + continue + next = [] + for c in children.pop(i): + parents_unseen = [p for p in rl.parentrevs(c) + if p != node.nullrev and p in children] + if len(parents_unseen) == 0: + next.append(c) + visit = next + visit + write('\n') + return ret + +def writerevs(r1, r2, order, tr): + write = sys.stdout.write + write('writing %d revs ' % len(order)) + try: + count = 0 + for rev in order: + n = r1.node(rev) + p1, p2 = r1.parents(n) + l = r1.linkrev(rev) + t = r1.revision(n) + n2 = r2.addrevision(t, tr, l, p1, p2) + + if count % 1000 == 0: + write('.') + count += 1 + finally: + write('\n') + +def report(olddatafn, newdatafn): + oldsize = float(os.stat(olddatafn).st_size) + newsize = float(os.stat(newdatafn).st_size) + + # argh: have to pass an int to %d, because a float >= 2^32 + # blows up under Python 2.5 or earlier + sys.stdout.write('old file size: %12d bytes (%6.1f MiB)\n' + % (int(oldsize), oldsize/1024/1024)) + sys.stdout.write('new file size: %12d bytes (%6.1f MiB)\n' + % (int(newsize), newsize/1024/1024)) + + shrink_percent = (oldsize - newsize) / oldsize * 100 + shrink_factor = oldsize / newsize + sys.stdout.write('shrinkage: %.1f%% (%.1fx)\n' + % (shrink_percent, shrink_factor)) + +def main(): + + # Unbuffer stdout for nice progress output. + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) + write = sys.stdout.write + + parser = optparse.OptionParser(description=__doc__) + parser.add_option('-R', '--repository', + default=os.path.curdir, + metavar='REPO', + help='repository root directory [default: current dir]') + parser.add_option('--revlog', + metavar='FILE', + help='shrink FILE [default: REPO/hg/store/00manifest.i]') + (options, args) = parser.parse_args() + if args: + parser.error('too many arguments') + + # Open the specified repository. + ui = ui_.ui() + repo = hg.repository(ui, options.repository) + if not repo.local(): + parser.error('not a local repository: %s' % options.repository) + + if options.revlog is None: + indexfn = repo.sjoin('00manifest.i') + else: + if not options.revlog.endswith('.i'): + parser.error('--revlog option must specify the revlog index file ' + '(*.i), not %s' % options.revlog) + + indexfn = os.path.realpath(options.revlog) + store = repo.sjoin('') + if not indexfn.startswith(store): + parser.error('--revlog option must specify a revlog in %s, not %s' + % (store, indexfn)) + + datafn = indexfn[:-2] + '.d' + if not os.path.exists(indexfn): + parser.error('no such file: %s' % indexfn) + if '00changelog' in indexfn: + parser.error('shrinking the changelog will corrupt your repository') + if not os.path.exists(datafn): + # This is just a lazy shortcut because I can't be bothered to + # handle all the special cases that entail from no .d file. + parser.error('%s does not exist: revlog not big enough ' + 'to be worth shrinking' % datafn) + + oldindexfn = indexfn + '.old' + olddatafn = datafn + '.old' + if os.path.exists(oldindexfn) or os.path.exists(olddatafn): + parser.error('one or both of\n' + ' %s\n' + ' %s\n' + 'exists from a previous run; please clean up before ' + 'running again' + % (oldindexfn, olddatafn)) + + write('shrinking %s\n' % indexfn) + prefix = os.path.basename(indexfn)[:-1] + (tmpfd, tmpindexfn) = tempfile.mkstemp(dir=os.path.dirname(indexfn), + prefix=prefix, + suffix='.i') + tmpdatafn = tmpindexfn[:-2] + '.d' + os.close(tmpfd) + + r1 = revlog.revlog(util.opener(os.getcwd(), audit=False), indexfn) + r2 = revlog.revlog(util.opener(os.getcwd(), audit=False), tmpindexfn) + + # Don't use repo.transaction(), because then things get hairy with + # paths: some need to be relative to .hg, and some need to be + # absolute. Doing it this way keeps things simple: everything is an + # absolute path. + lock = repo.lock(wait=False) + tr = transaction.transaction(sys.stderr.write, + open, + repo.sjoin('journal')) + + try: + try: + order = toposort(r1) + writerevs(r1, r2, order, tr) + report(datafn, tmpdatafn) + tr.close() + except: + # Abort transaction first, so we truncate the files before + # deleting them. + tr.abort() + if os.path.exists(tmpindexfn): + os.unlink(tmpindexfn) + if os.path.exists(tmpdatafn): + os.unlink(tmpdatafn) + raise + finally: + lock.release() + + os.link(indexfn, oldindexfn) + os.link(datafn, olddatafn) + os.rename(tmpindexfn, indexfn) + os.rename(tmpdatafn, datafn) + write('note: old revlog saved in:\n' + ' %s\n' + ' %s\n' + '(You can delete those files when you are satisfied that your\n' + 'repository is still sane. ' + 'Running \'hg verify\' is strongly recommended.)\n' + % (oldindexfn, olddatafn)) + +try: + main() +except KeyboardInterrupt: + sys.exit("interrupted") diff --git a/doc/gendoc.py b/doc/gendoc.py --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -1,9 +1,10 @@ -import os, sys, textwrap +import os, sys # import from the live mercurial repo sys.path.insert(0, "..") # fall back to pure modules if required C extensions are not available sys.path.append(os.path.join('..', 'mercurial', 'pure')) from mercurial import demandimport; demandimport.enable() +from mercurial import encoding from mercurial.commands import table, globalopts from mercurial.i18n import _ from mercurial.help import helptable @@ -55,9 +56,9 @@ def get_cmd(cmd): def show_doc(ui): def section(s): - ui.write("%s\n%s\n\n" % (s, "-" * len(s))) + ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) def subsection(s): - ui.write("%s\n%s\n\n" % (s, '"' * len(s))) + ui.write("%s\n%s\n\n" % (s, '"' * encoding.colwidth(s))) # print options section(_("OPTIONS")) @@ -92,9 +93,7 @@ def show_doc(ui): s = "%-*s %s" % (opts_len, optstr, desc) else: s = optstr - s = textwrap.fill(s, initial_indent=4 * " ", - subsequent_indent=(6 + opts_len) * " ") - ui.write("%s\n" % s) + ui.write(" %s\n" % s) ui.write("\n") # aliases if d['aliases']: diff --git a/doc/hg.1.txt b/doc/hg.1.txt --- a/doc/hg.1.txt +++ b/doc/hg.1.txt @@ -95,6 +95,6 @@ COPYING ------- Copyright \(C) 2005-2009 Matt Mackall. Free use of this software is granted under the terms of the GNU General -Public License (GPL). +Public License version 2. .. include:: common.txt diff --git a/doc/hgignore.5.txt b/doc/hgignore.5.txt --- a/doc/hgignore.5.txt +++ b/doc/hgignore.5.txt @@ -106,6 +106,6 @@ COPYING This manual page is copyright 2006 Vadim Gelfer. Mercurial is copyright 2005-2009 Matt Mackall. Free use of this software is granted under the terms of the GNU General -Public License (GPL). +Public License version 2. .. include:: common.txt diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -946,6 +946,6 @@ COPYING This manual page is copyright 2005 Bryan O'Sullivan. Mercurial is copyright 2005-2009 Matt Mackall. Free use of this software is granted under the terms of the GNU General -Public License (GPL). +Public License version 2. .. include:: common.txt diff --git a/help/dates.txt b/help/dates.txt new file mode 100644 --- /dev/null +++ b/help/dates.txt @@ -0,0 +1,36 @@ +Some commands allow the user to specify a date, e.g.: + +- backout, commit, import, tag: Specify the commit date. +- log, revert, update: Select revision(s) by date. + +Many date formats are valid. Here are some examples:: + + "Wed Dec 6 13:18:29 2006" (local timezone assumed) + "Dec 6 13:18 -0600" (year assumed, time offset provided) + "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) + "Dec 6" (midnight) + "13:18" (today assumed) + "3:39" (3:39AM assumed) + "3:39pm" (15:39) + "2006-12-06 13:18:29" (ISO 8601 format) + "2006-12-6 13:18" + "2006-12-6" + "12-6" + "12/6" + "12/6/6" (Dec 6 2006) + +Lastly, there is Mercurial's internal format:: + + "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC) + +This is the internal representation format for dates. unixtime is the +number of seconds since the epoch (1970-01-01 00:00 UTC). offset is +the offset of the local timezone, in seconds west of UTC (negative if +the timezone is east of UTC). + +The log command also accepts date ranges:: + + "<{datetime}" - at or before a given date/time + ">{datetime}" - on or after a given date/time + "{datetime} to {datetime}" - a date range, inclusive + "-{days}" - within a given number of days of today diff --git a/help/diffs.txt b/help/diffs.txt new file mode 100644 --- /dev/null +++ b/help/diffs.txt @@ -0,0 +1,29 @@ +Mercurial's default format for showing changes between two versions of +a file is compatible with the unified format of GNU diff, which can be +used by GNU patch and many other standard tools. + +While this standard format is often enough, it does not encode the +following information: + +- executable status and other permission bits +- copy or rename information +- changes in binary files +- creation or deletion of empty files + +Mercurial also supports the extended diff format from the git VCS +which addresses these limitations. The git diff format is not produced +by default because a few widespread tools still do not understand this +format. + +This means that when generating diffs from a Mercurial repository +(e.g. with "hg export"), you should be careful about things like file +copies and renames or other things mentioned above, because when +applying a standard diff to a different repository, this extra +information is lost. Mercurial's internal operations (like push and +pull) are not affected by this, because they use an internal binary +format for communicating changes. + +To make Mercurial produce the git extended diff format, use the --git +option available for many commands, or set 'git = True' in the [diff] +section of your hgrc. You do not need to set this option when +importing diffs in this format or using them in the mq extension. diff --git a/help/environment.txt b/help/environment.txt new file mode 100644 --- /dev/null +++ b/help/environment.txt @@ -0,0 +1,76 @@ +HG + Path to the 'hg' executable, automatically passed when running + hooks, extensions or external tools. If unset or empty, this is + the hg executable's name if it's frozen, or an executable named + 'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on + Windows) is searched. + +HGEDITOR + This is the name of the editor to run when committing. See EDITOR. + + (deprecated, use .hgrc) + +HGENCODING + This overrides the default locale setting detected by Mercurial. + This setting is used to convert data including usernames, + changeset descriptions, tag names, and branches. This setting can + be overridden with the --encoding command-line option. + +HGENCODINGMODE + This sets Mercurial's behavior for handling unknown characters + while transcoding user input. The default is "strict", which + causes Mercurial to abort if it can't map a character. Other + settings include "replace", which replaces unknown characters, and + "ignore", which drops them. This setting can be overridden with + the --encodingmode command-line option. + +HGMERGE + An executable to use for resolving merge conflicts. The program + will be executed with three arguments: local file, remote file, + ancestor file. + + (deprecated, use .hgrc) + +HGRCPATH + A list of files or directories to search for hgrc files. Item + separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set, + platform default search path is used. If empty, only the .hg/hgrc + from the current repository is read. + + For each element in HGRCPATH: + + - if it's a directory, all files ending with .rc are added + - otherwise, the file itself will be added + +HGUSER + This is the string used as the author of a commit. If not set, + available values will be considered in this order: + + - HGUSER (deprecated) + - hgrc files from the HGRCPATH + - EMAIL + - interactive prompt + - LOGNAME (with '@hostname' appended) + + (deprecated, use .hgrc) + +EMAIL + May be used as the author of a commit; see HGUSER. + +LOGNAME + May be used as the author of a commit; see HGUSER. + +VISUAL + This is the name of the editor to use when committing. See EDITOR. + +EDITOR + Sometimes Mercurial needs to open a text file in an editor for a + user to modify, for example when writing commit messages. The + editor it uses is determined by looking at the environment + variables HGEDITOR, VISUAL and EDITOR, in that order. The first + non-empty one is chosen. If all of them are empty, the editor + defaults to 'vi'. + +PYTHONPATH + This is used by Python to find imported modules and may need to be + set appropriately if this Mercurial is not installed system-wide. diff --git a/help/extensions.txt b/help/extensions.txt new file mode 100644 --- /dev/null +++ b/help/extensions.txt @@ -0,0 +1,33 @@ +Mercurial has the ability to add new features through the use of +extensions. Extensions may add new commands, add options to +existing commands, change the default behavior of commands, or +implement hooks. + +Extensions are not loaded by default for a variety of reasons: +they can increase startup overhead; they may be meant for advanced +usage only; they may provide potentially dangerous abilities (such +as letting you destroy or modify history); they might not be ready +for prime time; or they may alter some usual behaviors of stock +Mercurial. It is thus up to the user to activate extensions as +needed. + +To enable the "foo" extension, either shipped with Mercurial or in +the Python search path, create an entry for it in your hgrc, like +this:: + + [extensions] + foo = + +You may also specify the full path to an extension:: + + [extensions] + myfeature = ~/.hgext/myfeature.py + +To explicitly disable an extension enabled in an hgrc of broader +scope, prepend its path with !:: + + [extensions] + # disabling extension bar residing in /path/to/extension/bar.py + hgext.bar = !/path/to/extension/bar.py + # ditto, but no path was supplied for extension baz + hgext.baz = ! diff --git a/help/multirevs.txt b/help/multirevs.txt new file mode 100644 --- /dev/null +++ b/help/multirevs.txt @@ -0,0 +1,13 @@ +When Mercurial accepts more than one revision, they may be specified +individually, or provided as a topologically continuous range, +separated by the ":" character. + +The syntax of range notation is [BEGIN]:[END], where BEGIN and END are +revision identifiers. Both BEGIN and END are optional. If BEGIN is not +specified, it defaults to revision number 0. If END is not specified, +it defaults to the tip. The range ":" thus means "all revisions". + +If BEGIN is greater than END, revisions are treated in reverse order. + +A range acts as a closed interval. This means that a range of 3:5 +gives 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6. diff --git a/help/patterns.txt b/help/patterns.txt new file mode 100644 --- /dev/null +++ b/help/patterns.txt @@ -0,0 +1,41 @@ +Mercurial accepts several notations for identifying one or more files +at a time. + +By default, Mercurial treats filenames as shell-style extended glob +patterns. + +Alternate pattern notations must be specified explicitly. + +To use a plain path name without any pattern matching, start it with +"path:". These path names must completely match starting at the +current repository root. + +To use an extended glob, start a name with "glob:". Globs are rooted +at the current directory; a glob such as "``*.c``" will only match +files in the current directory ending with ".c". + +The supported glob syntax extensions are "``**``" to match any string +across path separators and "{a,b}" to mean "a or b". + +To use a Perl/Python regular expression, start a name with "re:". +Regexp pattern matching is anchored at the root of the repository. + +Plain examples:: + + path:foo/bar a name bar in a directory named foo in the root + of the repository + path:path:name a file or directory named "path:name" + +Glob examples:: + + glob:*.c any name ending in ".c" in the current directory + *.c any name ending in ".c" in the current directory + **.c any name ending in ".c" in any subdirectory of the + current directory including itself. + foo/*.c any name ending in ".c" in the directory foo + foo/**.c any name ending in ".c" in any subdirectory of foo + including itself. + +Regexp examples:: + + re:.*\.c$ any name ending in ".c", anywhere in the repository diff --git a/help/revisions.txt b/help/revisions.txt new file mode 100644 --- /dev/null +++ b/help/revisions.txt @@ -0,0 +1,29 @@ +Mercurial supports several ways to specify individual revisions. + +A plain integer is treated as a revision number. Negative integers are +treated as sequential offsets from the tip, with -1 denoting the tip, +-2 denoting the revision prior to the tip, and so forth. + +A 40-digit hexadecimal string is treated as a unique revision +identifier. + +A hexadecimal string less than 40 characters long is treated as a +unique revision identifier and is referred to as a short-form +identifier. A short-form identifier is only valid if it is the prefix +of exactly one full-length identifier. + +Any other string is treated as a tag or branch name. A tag name is a +symbolic name associated with a revision identifier. A branch name +denotes the tipmost revision of that branch. Tag and branch names must +not contain the ":" character. + +The reserved name "tip" is a special tag that always identifies the +most recent revision. + +The reserved name "null" indicates the null revision. This is the +revision of an empty repository, and the parent of revision 0. + +The reserved name "." indicates the working directory parent. If no +working directory is checked out, it is equivalent to null. If an +uncommitted merge is in progress, "." is the revision of the first +parent. diff --git a/help/templates.txt b/help/templates.txt new file mode 100644 --- /dev/null +++ b/help/templates.txt @@ -0,0 +1,113 @@ +Mercurial allows you to customize output of commands through +templates. You can either pass in a template from the command +line, via the --template option, or select an existing +template-style (--style). + +You can customize output for any "log-like" command: log, +outgoing, incoming, tip, parents, heads and glog. + +Three styles are packaged with Mercurial: default (the style used +when no explicit preference is passed), compact and changelog. +Usage:: + + $ hg log -r1 --style changelog + +A template is a piece of text, with markup to invoke variable +expansion:: + + $ hg log -r1 --template "{node}\n" + b56ce7b07c52de7d5fd79fb89701ea538af65746 + +Strings in curly braces are called keywords. The availability of +keywords depends on the exact context of the templater. These +keywords are usually available for templating a log-like command: + +:author: String. The unmodified author of the changeset. +:branches: String. The name of the branch on which the changeset + was committed. Will be empty if the branch name was + default. +:date: Date information. The date when the changeset was + committed. +:desc: String. The text of the changeset description. +:diffstat: String. Statistics of changes with the following + format: "modified files: +added/-removed lines" +:files: List of strings. All files modified, added, or removed + by this changeset. +:file_adds: List of strings. Files added by this changeset. +:file_mods: List of strings. Files modified by this changeset. +:file_dels: List of strings. Files removed by this changeset. +:node: String. The changeset identification hash, as a + 40-character hexadecimal string. +:parents: List of strings. The parents of the changeset. +:rev: Integer. The repository-local changeset revision + number. +:tags: List of strings. Any tags associated with the + changeset. +:latesttag: String. Most recent global tag in the ancestors of this + changeset. +:latesttagdistance: Integer. Longest path to the latest tag. + +The "date" keyword does not produce human-readable output. If you +want to use a date in your output, you can use a filter to process +it. Filters are functions which return a string based on the input +variable. You can also use a chain of filters to get the desired +output:: + + $ hg tip --template "{date|isodate}\n" + 2008-08-21 18:22 +0000 + +List of filters: + +:addbreaks: Any text. Add an XHTML "
" tag before the end of + every line except the last. +:age: Date. Returns a human-readable date/time difference + between the given date/time and the current + date/time. +:basename: Any text. Treats the text as a path, and returns the + last component of the path after splitting by the + path separator (ignoring trailing separators). For + example, "foo/bar/baz" becomes "baz" and "foo/bar//" + becomes "bar". +:stripdir: Treat the text as path and strip a directory level, + if possible. For example, "foo" and "foo/bar" becomes + "foo". +:date: Date. Returns a date in a Unix date format, including + the timezone: "Mon Sep 04 15:13:13 2006 0700". +:domain: Any text. Finds the first string that looks like an + email address, and extracts just the domain + component. Example: 'User ' becomes + 'example.com'. +:email: Any text. Extracts the first string that looks like + an email address. Example: 'User ' + becomes 'user@example.com'. +:escape: Any text. Replaces the special XML/XHTML characters + "&", "<" and ">" with XML entities. +:fill68: Any text. Wraps the text to fit in 68 columns. +:fill76: Any text. Wraps the text to fit in 76 columns. +:firstline: Any text. Returns the first line of text. +:nonempty: Any text. Returns '(none)' if the string is empty. +:hgdate: Date. Returns the date as a pair of numbers: + "1157407993 25200" (Unix timestamp, timezone offset). +:isodate: Date. Returns the date in ISO 8601 format: + "2009-08-18 13:00 +0200". +:isodatesec: Date. Returns the date in ISO 8601 format, including + seconds: "2009-08-18 13:00:13 +0200". See also the + rfc3339date filter. +:localdate: Date. Converts a date to local date. +:obfuscate: Any text. Returns the input text rendered as a + sequence of XML entities. +:person: Any text. Returns the text before an email address. +:rfc822date: Date. Returns a date using the same format used in + email headers: "Tue, 18 Aug 2009 13:00:13 +0200". +:rfc3339date: Date. Returns a date using the Internet date format + specified in RFC 3339: "2009-08-18T13:00:13+02:00". +:short: Changeset hash. Returns the short form of a changeset + hash, i.e. a 12-byte hexadecimal string. +:shortdate: Date. Returns a date like "2006-09-18". +:strip: Any text. Strips all leading and trailing whitespace. +:tabindent: Any text. Returns the text, with every line except + the first starting with a tab character. +:urlescape: Any text. Escapes all "special" characters. For + example, "foo bar" becomes "foo%20bar". +:user: Any text. Returns the user portion of an email + address. diff --git a/help/urls.txt b/help/urls.txt new file mode 100644 --- /dev/null +++ b/help/urls.txt @@ -0,0 +1,63 @@ +Valid URLs are of the form:: + + local/filesystem/path[#revision] + file://local/filesystem/path[#revision] + http://[user[:pass]@]host[:port]/[path][#revision] + https://[user[:pass]@]host[:port]/[path][#revision] + ssh://[user[:pass]@]host[:port]/[path][#revision] + +Paths in the local filesystem can either point to Mercurial +repositories or to bundle files (as created by 'hg bundle' or 'hg +incoming --bundle'). + +An optional identifier after # indicates a particular branch, tag, or +changeset to use from the remote repository. See also 'hg help +revisions'. + +Some features, such as pushing to http:// and https:// URLs are only +possible if the feature is explicitly enabled on the remote Mercurial +server. + +Some notes about using SSH with Mercurial: + +- SSH requires an accessible shell account on the destination machine + and a copy of hg in the remote path or specified with as remotecmd. +- path is relative to the remote user's home directory by default. Use + an extra slash at the start of a path to specify an absolute path:: + + ssh://example.com//tmp/repository + +- Mercurial doesn't use its own compression via SSH; the right thing + to do is to configure it in your ~/.ssh/config, e.g.:: + + Host *.mylocalnetwork.example.com + Compression no + Host * + Compression yes + + Alternatively specify "ssh -C" as your ssh command in your hgrc or + with the --ssh command line option. + +These URLs can all be stored in your hgrc with path aliases under the +[paths] section like so:: + + [paths] + alias1 = URL1 + alias2 = URL2 + ... + +You can then use the alias for any command that uses a URL (for +example 'hg pull alias1' would pull from the 'alias1' path). + +Two path aliases are special because they are used as defaults when +you do not provide the URL to a command: + +default: + When you create a repository with hg clone, the clone command saves + the location of the source repository as the new repository's + 'default' path. This is then used when you omit path from push- and + pull-like commands (including incoming and outgoing). + +default-push: + The push command will look for a path named 'default-push', and + prefer it over 'default' if both are defined. diff --git a/hgext/acl.py b/hgext/acl.py --- a/hgext/acl.py +++ b/hgext/acl.py @@ -60,12 +60,12 @@ import getpass, urllib def buildmatch(ui, repo, user, key): '''return tuple of (match function, list enabled).''' if not ui.has_section(key): - ui.debug(_('acl: %s not enabled\n') % key) + ui.debug('acl: %s not enabled\n' % key) return None pats = [pat for pat, users in ui.configitems(key) if user in users.replace(',', ' ').split()] - ui.debug(_('acl: %s enabled, %d entries for user %s\n') % + ui.debug('acl: %s enabled, %d entries for user %s\n' % (key, len(pats), user)) if pats: return match.match(repo.root, '', pats) @@ -77,7 +77,7 @@ def hook(ui, repo, hooktype, node=None, raise util.Abort(_('config error - hook type "%s" cannot stop ' 'incoming changesets') % hooktype) if source not in ui.config('acl', 'sources', 'serve').split(): - ui.debug(_('acl: changes have source "%s" - skipping\n') % source) + ui.debug('acl: changes have source "%s" - skipping\n' % source) return user = None @@ -99,9 +99,9 @@ def hook(ui, repo, hooktype, node=None, ctx = repo[rev] for f in ctx.files(): if deny and deny(f): - ui.debug(_('acl: user %s denied on %s\n') % (user, f)) + ui.debug('acl: user %s denied on %s\n' % (user, f)) raise util.Abort(_('acl: access denied for changeset %s') % ctx) if allow and not allow(f): - ui.debug(_('acl: user %s not allowed on %s\n') % (user, f)) + ui.debug('acl: user %s not allowed on %s\n' % (user, f)) raise util.Abort(_('acl: access denied for changeset %s') % ctx) - ui.debug(_('acl: allowing changeset %s\n') % ctx) + ui.debug('acl: allowing changeset %s\n' % ctx) diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -153,7 +153,7 @@ def churn(ui, repo, *pats, **opts): maxname = max(len(k) for k, v in rate) ttywidth = util.termwidth() - ui.debug(_("assuming %i character terminal\n") % ttywidth) + ui.debug("assuming %i character terminal\n" % ttywidth) width = ttywidth - maxname - 2 - 6 - 2 - 2 for date, count in rate: diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -160,25 +160,26 @@ def colorqseries(orig, ui, repo, *dummy, return retval _patch_effects = { 'applied': ['blue', 'bold', 'underline'], - 'missing': ['red', 'bold'], - 'unapplied': ['black', 'bold'], } - -def colorwrap(orig, s): + 'missing': ['red', 'bold'], + 'unapplied': ['black', 'bold'], } +def colorwrap(orig, *args): '''wrap ui.write for colored diff output''' - lines = s.split('\n') - for i, line in enumerate(lines): - stripline = line - if line and line[0] in '+-': - # highlight trailing whitespace, but only in changed lines - stripline = line.rstrip() - for prefix, style in _diff_prefixes: - if stripline.startswith(prefix): - lines[i] = render_effects(stripline, _diff_effects[style]) - break - if line != stripline: - lines[i] += render_effects( - line[len(stripline):], _diff_effects['trailingwhitespace']) - orig('\n'.join(lines)) + def _colorize(s): + lines = s.split('\n') + for i, line in enumerate(lines): + stripline = line + if line and line[0] in '+-': + # highlight trailing whitespace, but only in changed lines + stripline = line.rstrip() + for prefix, style in _diff_prefixes: + if stripline.startswith(prefix): + lines[i] = render_effects(stripline, _diff_effects[style]) + break + if line != stripline: + lines[i] += render_effects( + line[len(stripline):], _diff_effects['trailingwhitespace']) + return '\n'.join(lines) + orig(*[_colorize(s) for s in args]) def colorshowpatch(orig, self, node): '''wrap cmdutil.changeset_printer.showpatch with colored output''' @@ -235,6 +236,13 @@ def uisetup(ui): # The mq extension is not enabled pass + try: + rec = extensions.find('record') + _setupcmd(ui, 'record', rec.cmdtable, colordiff, _diff_effects) + except KeyError: + # The record extension is not enabled + pass + def _setupcmd(ui, cmd, table, func, effectsmap): '''patch in command to command table and load effect map''' def nocolor(orig, *args, **opts): @@ -256,7 +264,7 @@ def _setupcmd(ui, cmd, table, func, effe entry = extensions.wrapcommand(table, cmd, nocolor) entry[1].extend([ ('', 'color', 'auto', _("when to colorize (always, auto, or never)")), - ('', 'no-color', None, _("don't colorize output")), + ('', 'no-color', None, _("don't colorize output (DEPRECATED)")), ]) for status in effectsmap: diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -142,23 +142,8 @@ def convert(ui, src, dest=None, revmapfi converted, and that any directory reorganization in the CVS sandbox is ignored. - Because CVS does not have changesets, it is necessary to collect - individual commits to CVS and merge them into changesets. CVS - source uses its internal changeset merging code by default but can - be configured to call the external 'cvsps' program by setting:: - - --config convert.cvsps='cvsps -A -u --cvs-direct -q' - - This option is deprecated and will be removed in Mercurial 1.4. - The options shown are the defaults. - Internal cvsps is selected by setting :: - - --config convert.cvsps=builtin - - and has a few more configurable options: - --config convert.cvsps.cache=True (boolean) Set to False to disable remote log caching, for testing and debugging purposes. @@ -178,9 +163,10 @@ def convert(ui, src, dest=None, revmapfi add the most recent revision on the branch indicated in the regex as the second parent of the changeset. - The hgext/convert/cvsps wrapper script allows the builtin + An additional "debugcvsps" Mercurial command allows the builtin changeset merging code to be run without doing a conversion. Its - parameters and output are similar to that of cvsps 2.1. + parameters and output are similar to that of cvsps 2.1. Please see + the command help for more details. Subversion Source ----------------- diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -266,7 +266,7 @@ class commandline(object): def _run(self, cmd, *args, **kwargs): cmdline = self._cmdline(cmd, *args, **kwargs) - self.ui.debug(_('running: %s\n') % (cmdline,)) + self.ui.debug('running: %s\n' % (cmdline,)) self.prerun() try: return util.popen(cmdline) @@ -365,7 +365,7 @@ class mapfile(dict): return for i, line in enumerate(fp): try: - key, value = line[:-1].rsplit(' ', 1) + key, value = line.splitlines()[0].rsplit(' ', 1) except ValueError: raise util.Abort(_('syntax error in %s(%d): key/value pair expected') % (self.path, i+1)) diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -22,21 +22,11 @@ class convert_cvs(converter_source): raise NoRepo("%s does not look like a CVS checkout" % path) checktool('cvs') - self.cmd = ui.config('convert', 'cvsps', 'builtin') - cvspsexe = self.cmd.split(None, 1)[0] - self.builtin = cvspsexe == 'builtin' - if not self.builtin: - ui.warn(_('warning: support for external cvsps is deprecated and ' - 'will be removed in Mercurial 1.4\n')) - - if not self.builtin: - checktool(cvspsexe) self.changeset = None self.files = {} self.tags = {} self.lastbranch = {} - self.parent = {} self.socket = None self.cvsroot = open(os.path.join(cvs, "Root")).read()[:-1] self.cvsrepo = open(os.path.join(cvs, "Repository")).read()[:-1] @@ -50,19 +40,13 @@ class convert_cvs(converter_source): self.changeset = {} maxrev = 0 - cmd = self.cmd if self.rev: # TODO: handle tags try: # patchset number? maxrev = int(self.rev) except ValueError: - try: - # date - util.parsedate(self.rev, ['%Y/%m/%d %H:%M:%S']) - cmd = '%s -d "1970/01/01 00:00:01" -d "%s"' % (cmd, self.rev) - except util.Abort: - raise util.Abort(_('revision %s is not a patchset number or date') % self.rev) + raise util.Abort(_('revision %s is not a patchset number') % self.rev) d = os.getcwd() try: @@ -71,116 +55,36 @@ class convert_cvs(converter_source): state = 0 filerevids = {} - if self.builtin: - # builtin cvsps code - self.ui.status(_('using builtin cvsps\n')) - - cache = 'update' - if not self.ui.configbool('convert', 'cvsps.cache', True): - cache = None - db = cvsps.createlog(self.ui, cache=cache) - db = cvsps.createchangeset(self.ui, db, - fuzz=int(self.ui.config('convert', 'cvsps.fuzz', 60)), - mergeto=self.ui.config('convert', 'cvsps.mergeto', None), - mergefrom=self.ui.config('convert', 'cvsps.mergefrom', None)) - - for cs in db: - if maxrev and cs.id>maxrev: - break - id = str(cs.id) - cs.author = self.recode(cs.author) - self.lastbranch[cs.branch] = id - cs.comment = self.recode(cs.comment) - date = util.datestr(cs.date) - self.tags.update(dict.fromkeys(cs.tags, id)) - - files = {} - for f in cs.entries: - files[f.file] = "%s%s" % ('.'.join([str(x) for x in f.revision]), - ['', '(DEAD)'][f.dead]) + cache = 'update' + if not self.ui.configbool('convert', 'cvsps.cache', True): + cache = None + db = cvsps.createlog(self.ui, cache=cache) + db = cvsps.createchangeset(self.ui, db, + fuzz=int(self.ui.config('convert', 'cvsps.fuzz', 60)), + mergeto=self.ui.config('convert', 'cvsps.mergeto', None), + mergefrom=self.ui.config('convert', 'cvsps.mergefrom', None)) - # add current commit to set - c = commit(author=cs.author, date=date, - parents=[str(p.id) for p in cs.parents], - desc=cs.comment, branch=cs.branch or '') - self.changeset[id] = c - self.files[id] = files - else: - # external cvsps - for l in util.popen(cmd): - if state == 0: # header - if l.startswith("PatchSet"): - id = l[9:-2] - if maxrev and int(id) > maxrev: - # ignore everything - state = 3 - elif l.startswith("Date:"): - date = util.parsedate(l[6:-1], ["%Y/%m/%d %H:%M:%S"]) - date = util.datestr(date) - elif l.startswith("Branch:"): - branch = l[8:-1] - self.parent[id] = self.lastbranch.get(branch, 'bad') - self.lastbranch[branch] = id - elif l.startswith("Ancestor branch:"): - ancestor = l[17:-1] - # figure out the parent later - self.parent[id] = self.lastbranch[ancestor] - elif l.startswith("Author:"): - author = self.recode(l[8:-1]) - elif l.startswith("Tag:") or l.startswith("Tags:"): - t = l[l.index(':')+1:] - t = [ut.strip() for ut in t.split(',')] - if (len(t) > 1) or (t[0] and (t[0] != "(none)")): - self.tags.update(dict.fromkeys(t, id)) - elif l.startswith("Log:"): - # switch to gathering log - state = 1 - log = "" - elif state == 1: # log - if l == "Members: \n": - # switch to gathering members - files = {} - oldrevs = [] - log = self.recode(log[:-1]) - state = 2 - else: - # gather log - log += l - elif state == 2: # members - if l == "\n": # start of next entry - state = 0 - p = [self.parent[id]] - if id == "1": - p = [] - if branch == "HEAD": - branch = "" - if branch: - latest = 0 - # the last changeset that contains a base - # file is our parent - for r in oldrevs: - latest = max(filerevids.get(r, 0), latest) - if latest: - p = [latest] + for cs in db: + if maxrev and cs.id>maxrev: + break + id = str(cs.id) + cs.author = self.recode(cs.author) + self.lastbranch[cs.branch] = id + cs.comment = self.recode(cs.comment) + date = util.datestr(cs.date) + self.tags.update(dict.fromkeys(cs.tags, id)) - # add current commit to set - c = commit(author=author, date=date, parents=p, - desc=log, branch=branch) - self.changeset[id] = c - self.files[id] = files - else: - colon = l.rfind(':') - file = l[1:colon] - rev = l[colon+1:-2] - oldrev, rev = rev.split("->") - files[file] = rev + files = {} + for f in cs.entries: + files[f.file] = "%s%s" % ('.'.join([str(x) for x in f.revision]), + ['', '(DEAD)'][f.dead]) - # save some information for identifying branch points - oldrevs.append("%s:%s" % (oldrev, file)) - filerevids["%s:%s" % (rev, file)] = id - elif state == 3: - # swallow all input - continue + # add current commit to set + c = commit(author=cs.author, date=date, + parents=[str(p.id) for p in cs.parents], + desc=cs.comment, branch=cs.branch or '') + self.changeset[id] = c + self.files[id] = files self.heads = self.lastbranch.values() finally: diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -199,7 +199,7 @@ def createlog(ui, directory=None, root=" cmd = [util.shellquote(arg) for arg in cmd] ui.note(_("running %s\n") % (' '.join(cmd))) - ui.debug(_("prefix=%r directory=%r root=%r\n") % (prefix, directory, root)) + ui.debug("prefix=%r directory=%r root=%r\n" % (prefix, directory, root)) pfp = util.popen(' '.join(cmd)) peek = pfp.readline() @@ -378,7 +378,7 @@ def createlog(ui, directory=None, root=" e.revision[-1] == 1 and # 1.1 or 1.1.x.1 len(e.comment) == 1 and file_added_re.match(e.comment[0])): - ui.debug(_('found synthetic revision in %s: %r\n') + ui.debug('found synthetic revision in %s: %r\n' % (e.rcs, e.comment[0])) e.synthetic = True diff --git a/hgext/convert/darcs.py b/hgext/convert/darcs.py --- a/hgext/convert/darcs.py +++ b/hgext/convert/darcs.py @@ -75,7 +75,7 @@ class darcs_source(converter_source, com self.parents[child] = [] def after(self): - self.ui.debug(_('cleaning up %s\n') % self.tmppath) + self.ui.debug('cleaning up %s\n' % self.tmppath) shutil.rmtree(self.tmppath, ignore_errors=True) def xml(self, cmd, **kwargs): @@ -85,6 +85,17 @@ class darcs_source(converter_source, com self.checkexit(fp.close()) return etree.getroot() + def manifest(self): + man = [] + output, status = self.run('show', 'files', no_directories=True, + repodir=self.tmppath) + self.checkexit(status) + for line in output.split('\n'): + path = line[2:] + if path: + man.append(path) + return man + def getheads(self): return self.parents[None] @@ -107,18 +118,35 @@ class darcs_source(converter_source, com output, status = self.run('revert', all=True, repodir=self.tmppath) self.checkexit(status, output) - def getchanges(self, rev): - self.pull(rev) + def getchanges(self, rev): copies = {} changes = [] + man = None for elt in self.changes[rev].find('summary').getchildren(): if elt.tag in ('add_directory', 'remove_directory'): continue if elt.tag == 'move': - changes.append((elt.get('from'), rev)) - copies[elt.get('from')] = elt.get('to') + if man is None: + man = self.manifest() + source, dest = elt.get('from'), elt.get('to') + if source in man: + # File move + changes.append((source, rev)) + changes.append((dest, rev)) + copies[dest] = source + else: + # Directory move, deduce file moves from manifest + source = source + '/' + for f in man: + if not f.startswith(source): + continue + fdest = dest + '/' + f[len(source):] + changes.append((f, rev)) + changes.append((fdest, rev)) + copies[fdest] = f else: changes.append((elt.text.strip(), rev)) + self.pull(rev) self.lastrev = rev return sorted(changes), copies diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py --- a/hgext/convert/gnuarch.py +++ b/hgext/convert/gnuarch.py @@ -125,7 +125,7 @@ class gnuarch_source(converter_source, c break def after(self): - self.ui.debug(_('cleaning up %s\n') % self.tmppath) + self.ui.debug('cleaning up %s\n' % self.tmppath) shutil.rmtree(self.tmppath, ignore_errors=True) def getheads(self): @@ -195,7 +195,7 @@ class gnuarch_source(converter_source, c return os.system(cmdline) def _update(self, rev): - self.ui.debug(_('applying revision %s...\n') % rev) + self.ui.debug('applying revision %s...\n' % rev) changeset, status = self.runlines('replay', '-d', self.tmppath, rev) if status: @@ -205,7 +205,7 @@ class gnuarch_source(converter_source, c self._obtainrevision(rev) else: old_rev = self.parents[rev][0] - self.ui.debug(_('computing changeset between %s and %s...\n') + self.ui.debug('computing changeset between %s and %s...\n' % (old_rev, rev)) self._parsechangeset(changeset, rev) @@ -254,10 +254,10 @@ class gnuarch_source(converter_source, c return changes, copies def _obtainrevision(self, rev): - self.ui.debug(_('obtaining revision %s...\n') % rev) + self.ui.debug('obtaining revision %s...\n' % rev) output = self._execute('get', rev, self.tmppath) self.checkexit(output) - self.ui.debug(_('analyzing revision %s...\n') % rev) + self.ui.debug('analyzing revision %s...\n' % rev) files = self._readcontents(self.tmppath) self.changes[rev].add_files += files diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -55,12 +55,12 @@ class mercurial_sink(converter_sink): self.filemapmode = False def before(self): - self.ui.debug(_('run hg sink pre-conversion action\n')) + self.ui.debug('run hg sink pre-conversion action\n') self.wlock = self.repo.wlock() self.lock = self.repo.lock() def after(self): - self.ui.debug(_('run hg sink post-conversion action\n')) + self.ui.debug('run hg sink post-conversion action\n') self.lock.release() self.wlock.release() @@ -248,8 +248,7 @@ class mercurial_source(converter_source) return self.lastctx def parents(self, ctx): - return [p.node() for p in ctx.parents() - if p and self.keep(p.node())] + return [p for p in ctx.parents() if p and self.keep(p.node())] def getheads(self): if self.rev: @@ -275,20 +274,20 @@ class mercurial_source(converter_source) if self.ignoreerrors: # calling getcopies() is a simple way to detect missing # revlogs and populate self.ignored - self.getcopies(ctx, files) + self.getcopies(ctx, parents, files) return [(f, rev) for f in files if f not in self.ignored], {} if self._changescache and self._changescache[0] == rev: m, a, r = self._changescache[1] else: - m, a, r = self.repo.status(parents[0], ctx.node())[:3] + m, a, r = self.repo.status(parents[0].node(), ctx.node())[:3] # getcopies() detects missing revlogs early, run it before # filtering the changes. - copies = self.getcopies(ctx, m + a) + copies = self.getcopies(ctx, parents, m + a) changes = [(name, rev) for name in m + a + r if name not in self.ignored] return sorted(changes), copies - def getcopies(self, ctx, files): + def getcopies(self, ctx, parents, files): copies = {} for name in files: if name in self.ignored: @@ -297,6 +296,14 @@ class mercurial_source(converter_source) copysource, copynode = ctx.filectx(name).renamed() if copysource in self.ignored or not self.keep(copynode): continue + # Ignore copy sources not in parent revisions + found = False + for p in parents: + if copysource in p: + found = True + break + if not found: + continue copies[name] = copysource except TypeError: pass @@ -309,7 +316,7 @@ class mercurial_source(converter_source) def getcommit(self, rev): ctx = self.changectx(rev) - parents = [hex(p) for p in self.parents(ctx)] + parents = [p.hex() for p in self.parents(ctx)] if self.saverev: crev = rev else: @@ -332,7 +339,7 @@ class mercurial_source(converter_source) changes = [], ctx.manifest().keys(), [] else: i = i or 0 - changes = self.repo.status(parents[i], ctx.node())[:3] + changes = self.repo.status(parents[i].node(), ctx.node())[:3] changes = [[f for f in l if f not in self.ignored] for l in changes] if i == 0: @@ -348,10 +355,10 @@ class mercurial_source(converter_source) self.convertfp.flush() def before(self): - self.ui.debug(_('run hg source pre-conversion action\n')) + self.ui.debug('run hg source pre-conversion action\n') def after(self): - self.ui.debug(_('run hg source post-conversion action\n')) + self.ui.debug('run hg source post-conversion action\n') def hasnativeorder(self): return True diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py --- a/hgext/convert/p4.py +++ b/hgext/convert/p4.py @@ -53,7 +53,7 @@ class p4_source(converter_source): def _parse_view(self, path): "Read changes affecting the path" cmd = 'p4 -G changes -s submitted "%s"' % path - stdout = util.popen(cmd) + stdout = util.popen(cmd, mode='rb') for d in loaditer(stdout): c = d.get("change", None) if c: @@ -72,7 +72,7 @@ class p4_source(converter_source): views = {"//": ""} else: cmd = 'p4 -G client -o "%s"' % path - clientspec = marshal.load(util.popen(cmd)) + clientspec = marshal.load(util.popen(cmd, mode='rb')) views = {} for client in clientspec: @@ -105,7 +105,7 @@ class p4_source(converter_source): lastid = None for change in self.p4changes: cmd = "p4 -G describe %s" % change - stdout = util.popen(cmd) + stdout = util.popen(cmd, mode='rb') d = marshal.load(stdout) desc = self.recode(d["desc"]) @@ -147,7 +147,7 @@ class p4_source(converter_source): def getfile(self, name, rev): cmd = 'p4 -G print "%s#%s"' % (self.depotname[name], rev) - stdout = util.popen(cmd) + stdout = util.popen(cmd, mode='rb') mode = None contents = "" diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -22,6 +22,7 @@ from common import NoRepo, MissingTool, from common import commandline, converter_source, converter_sink, mapfile try: + raise ImportError("SVN support disabled due to license incompatibility") from svn.core import SubversionException, Pool import svn import svn.client @@ -114,7 +115,11 @@ class logstream(object): def __iter__(self): while True: - entry = pickle.load(self._stdout) + try: + entry = pickle.load(self._stdout) + except EOFError: + raise util.Abort(_('Mercurial failed to run itself, check' + ' hg executable is in PATH')) try: orig_paths, revnum, author, date, message = entry except: @@ -152,11 +157,13 @@ protomap = {'http': httpcheck, def issvnurl(url): try: proto, path = url.split('://', 1) - path = urllib.url2pathname(path) + if proto == 'file': + path = urllib.url2pathname(path) except ValueError: proto = 'file' path = os.path.abspath(url) - path = path.replace(os.sep, '/') + if proto == 'file': + path = path.replace(os.sep, '/') check = protomap.get(proto, lambda p, p2: False) while '/' in path: if check(path, proto): @@ -531,7 +538,7 @@ class svn_source(converter_source): """ if not path.startswith(self.rootmodule): # Requests on foreign branches may be forbidden at server level - self.ui.debug(_('ignoring foreign branch %r\n') % path) + self.ui.debug('ignoring foreign branch %r\n' % path) return None if not stop: @@ -559,7 +566,7 @@ class svn_source(converter_source): if not path.startswith(p) or not paths[p].copyfrom_path: continue newpath = paths[p].copyfrom_path + path[len(p):] - self.ui.debug(_("branch renamed from %s to %s at %d\n") % + self.ui.debug("branch renamed from %s to %s at %d\n" % (path, newpath, revnum)) path = newpath break @@ -567,7 +574,7 @@ class svn_source(converter_source): stream.close() if not path.startswith(self.rootmodule): - self.ui.debug(_('ignoring foreign branch %r\n') % path) + self.ui.debug('ignoring foreign branch %r\n' % path) return None return self.revid(dirent.created_rev, path) @@ -579,7 +586,7 @@ class svn_source(converter_source): prevmodule = self.prevmodule if prevmodule is None: prevmodule = '' - self.ui.debug(_("reparent to %s\n") % svnurl) + self.ui.debug("reparent to %s\n" % svnurl) svn.ra.reparent(self.ra, svnurl) self.prevmodule = module return prevmodule @@ -612,14 +619,14 @@ class svn_source(converter_source): copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule) if not copyfrom_path: continue - self.ui.debug(_("copied to %s from %s@%s\n") % + self.ui.debug("copied to %s from %s@%s\n" % (entrypath, copyfrom_path, ent.copyfrom_rev)) copies[self.recode(entrypath)] = self.recode(copyfrom_path) elif kind == 0: # gone, but had better be a deleted *file* - self.ui.debug(_("gone from %s\n") % ent.copyfrom_rev) + self.ui.debug("gone from %s\n" % ent.copyfrom_rev) pmodule, prevnum = self.revsplit(parents[0])[1:] parentpath = pmodule + "/" + entrypath - self.ui.debug(_("entry %s\n") % parentpath) + self.ui.debug("entry %s\n" % parentpath) # We can avoid the reparent calls if the module has # not changed but it probably does not worth the pain. @@ -646,7 +653,7 @@ class svn_source(converter_source): del copies[childpath] entries.append(childpath) else: - self.ui.debug(_('unknown path in revision %d: %s\n') % \ + self.ui.debug('unknown path in revision %d: %s\n' % \ (revnum, path)) elif kind == svn.core.svn_node_dir: # If the directory just had a prop change, @@ -679,7 +686,7 @@ class svn_source(converter_source): if not copyfrompath: continue copyfrom[path] = ent - self.ui.debug(_("mark %s came from %s:%d\n") + self.ui.debug("mark %s came from %s:%d\n" % (path, copyfrompath, ent.copyfrom_rev)) children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) children.sort() @@ -703,7 +710,7 @@ class svn_source(converter_source): """Return the parsed commit object or None, and True if the revision is a branch root. """ - self.ui.debug(_("parsing revision %d (%d changes)\n") % + self.ui.debug("parsing revision %d (%d changes)\n" % (revnum, len(orig_paths))) branched = False @@ -732,7 +739,7 @@ class svn_source(converter_source): self.ui.note(_('found parent of branch %s at %d: %s\n') % (self.module, prevnum, prevmodule)) else: - self.ui.debug(_("no copyfrom path, don't know what to do.\n")) + self.ui.debug("no copyfrom path, don't know what to do.\n") paths = [] # filter out unrelated paths @@ -785,7 +792,7 @@ class svn_source(converter_source): lastonbranch = True break if not paths: - self.ui.debug(_('revision %d has no entries\n') % revnum) + self.ui.debug('revision %d has no entries\n' % revnum) continue cset, lastonbranch = parselogentry(paths, revnum, author, date, message) @@ -867,7 +874,7 @@ class svn_source(converter_source): return relative # The path is outside our tracked tree... - self.ui.debug(_('%r is not under %r, ignoring\n') % (path, module)) + self.ui.debug('%r is not under %r, ignoring\n' % (path, module)) return None def _checkpath(self, path, revnum): diff --git a/hgext/extdiff.py b/hgext/extdiff.py --- a/hgext/extdiff.py +++ b/hgext/extdiff.py @@ -42,9 +42,9 @@ fast (at least faster than having to com ''' from mercurial.i18n import _ -from mercurial.node import short +from mercurial.node import short, nullid from mercurial import cmdutil, util, commands -import os, shlex, shutil, tempfile +import os, shlex, shutil, tempfile, re def snapshot(ui, repo, files, node, tmproot): '''snapshot files as of some revision @@ -69,7 +69,7 @@ def snapshot(ui, repo, files, node, tmpr for fn in files: wfn = util.pconvert(fn) if not wfn in ctx: - # skipping new file after a merge ? + # File doesn't exist; could be a bogus modify continue ui.note(' %s\n' % wfn) dest = os.path.join(base, wfn) @@ -96,59 +96,102 @@ def dodiff(ui, repo, diffcmd, diffopts, revs = opts.get('rev') change = opts.get('change') + args = ' '.join(diffopts) + do3way = '$parent2' in args if revs and change: msg = _('cannot specify --rev and --change at the same time') raise util.Abort(msg) elif change: node2 = repo.lookup(change) - node1 = repo[node2].parents()[0].node() + node1a, node1b = repo.changelog.parents(node2) else: - node1, node2 = cmdutil.revpair(repo, revs) + node1a, node2 = cmdutil.revpair(repo, revs) + if not revs: + node1b = repo.dirstate.parents()[1] + else: + node1b = nullid + + # Disable 3-way merge if there is only one parent + if do3way: + if node1b == nullid: + do3way = False matcher = cmdutil.match(repo, pats, opts) - modified, added, removed = repo.status(node1, node2, matcher)[:3] - if not (modified or added or removed): - return 0 + mod_a, add_a, rem_a = map(set, repo.status(node1a, node2, matcher)[:3]) + if do3way: + mod_b, add_b, rem_b = map(set, repo.status(node1b, node2, matcher)[:3]) + else: + mod_b, add_b, rem_b = set(), set(), set() + modadd = mod_a | add_a | mod_b | add_b + common = modadd | rem_a | rem_b + if not common: + return 0 tmproot = tempfile.mkdtemp(prefix='extdiff.') - dir2root = '' try: - # Always make a copy of node1 - dir1 = snapshot(ui, repo, modified + removed, node1, tmproot)[0] - changes = len(modified) + len(removed) + len(added) + # Always make a copy of node1a (and node1b, if applicable) + dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a) + dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot)[0] + if do3way: + dir1b_files = mod_b | rem_b | ((mod_a | add_a) - add_b) + dir1b = snapshot(ui, repo, dir1b_files, node1b, tmproot)[0] + else: + dir1b = None + + fns_and_mtime = [] # If node2 in not the wc or there is >1 change, copy it - if node2 or changes > 1: - dir2, fns_and_mtime = snapshot(ui, repo, modified + added, node2, tmproot) + dir2root = '' + if node2: + dir2 = snapshot(ui, repo, modadd, node2, tmproot)[0] + elif len(common) > 1: + #we only actually need to get the files to copy back to the working + #dir in this case (because the other cases are: diffing 2 revisions + #or single file -- in which case the file is already directly passed + #to the diff tool). + dir2, fns_and_mtime = snapshot(ui, repo, modadd, None, tmproot) else: # This lets the diff tool open the changed file directly dir2 = '' dir2root = repo.root - fns_and_mtime = [] # If only one change, diff the files instead of the directories - if changes == 1 : - if len(modified): - dir1 = os.path.join(dir1, util.localpath(modified[0])) - dir2 = os.path.join(dir2root, dir2, util.localpath(modified[0])) - elif len(removed) : - dir1 = os.path.join(dir1, util.localpath(removed[0])) - dir2 = os.devnull - else: - dir1 = os.devnull - dir2 = os.path.join(dir2root, dir2, util.localpath(added[0])) + # Handle bogus modifies correctly by checking if the files exist + if len(common) == 1: + common_file = util.localpath(common.pop()) + dir1a = os.path.join(dir1a, common_file) + if not os.path.isfile(os.path.join(tmproot, dir1a)): + dir1a = os.devnull + if do3way: + dir1b = os.path.join(dir1b, common_file) + if not os.path.isfile(os.path.join(tmproot, dir1b)): + dir1b = os.devnull + dir2 = os.path.join(dir2root, dir2, common_file) - cmdline = ('%s %s %s %s' % - (util.shellquote(diffcmd), ' '.join(diffopts), - util.shellquote(dir1), util.shellquote(dir2))) - ui.debug(_('running %r in %s\n') % (cmdline, tmproot)) + # Function to quote file/dir names in the argument string + # When not operating in 3-way mode, an empty string is returned for parent2 + replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b, child=dir2) + def quote(match): + key = match.group()[1:] + if not do3way and key == 'parent2': + return '' + return util.shellquote(replace[key]) + + # Match parent2 first, so 'parent1?' will match both parent1 and parent + regex = '\$(parent2|parent1?|child)' + if not do3way and not re.search(regex, args): + args += ' $parent1 $child' + args = re.sub(regex, quote, args) + cmdline = util.shellquote(diffcmd) + ' ' + args + + ui.debug('running %r in %s\n' % (cmdline, tmproot)) util.system(cmdline, cwd=tmproot) for copy_fn, working_fn, mtime in fns_and_mtime: if os.path.getmtime(copy_fn) != mtime: - ui.debug(_('file changed while diffing. ' - 'Overwriting: %s (src: %s)\n') % (working_fn, copy_fn)) + ui.debug('file changed while diffing. ' + 'Overwriting: %s (src: %s)\n' % (working_fn, copy_fn)) util.copyfile(copy_fn, working_fn) return 1 @@ -173,11 +216,11 @@ def extdiff(ui, repo, *pats, **opts): that revision is compared to the working directory, and, when no revisions are specified, the working directory files are compared to its parent.''' - program = opts['program'] or 'diff' - if opts['program']: - option = opts['option'] - else: - option = opts['option'] or ['-Npru'] + program = opts.get('program') + option = opts.get('option') + if not program: + program = 'diff' + option = option or ['-Npru'] return dodiff(ui, repo, program, option, pats, opts) cmdtable = { diff --git a/hgext/hgcia.py b/hgext/hgcia.py --- a/hgext/hgcia.py +++ b/hgext/hgcia.py @@ -229,10 +229,10 @@ def hook(ui, repo, hooktype, node=None, n = bin(node) cia = hgcia(ui, repo) if not cia.user: - ui.debug(_('cia: no user specified')) + ui.debug('cia: no user specified') return if not cia.project: - ui.debug(_('cia: no project specified')) + ui.debug('cia: no project specified') return if hooktype == 'changegroup': start = repo.changelog.rev(n) diff --git a/hgext/hgk.py b/hgext/hgk.py --- a/hgext/hgk.py +++ b/hgext/hgk.py @@ -308,7 +308,7 @@ def view(ui, repo, *etc, **opts): os.chdir(repo.root) optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v]) cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc)) - ui.debug(_("running %s\n") % cmd) + ui.debug("running %s\n" % cmd) util.system(cmd) cmdtable = { diff --git a/hgext/inotify/__init__.py b/hgext/inotify/__init__.py --- a/hgext/inotify/__init__.py +++ b/hgext/inotify/__init__.py @@ -17,28 +17,7 @@ from client import client, QueryFailed def serve(ui, repo, **opts): '''start an inotify server for this repository''' - timeout = opts.get('timeout') - if timeout: - timeout = float(timeout) * 1e3 - - class service(object): - def init(self): - try: - self.master = server.master(ui, repo.dirstate, - repo.root, timeout) - except server.AlreadyStartedException, inst: - raise util.Abort(str(inst)) - - def run(self): - try: - self.master.run() - finally: - self.master.shutdown() - - service = service() - logfile = ui.config('inotify', 'log') - cmdutil.service(opts, initfn=service.init, runfn=service.run, - logfile=logfile) + server.start(ui, repo.dirstate, repo.root, opts) def debuginotify(ui, repo, **opts): '''debugging information for inotify extension diff --git a/hgext/inotify/client.py b/hgext/inotify/client.py --- a/hgext/inotify/client.py +++ b/hgext/inotify/client.py @@ -31,10 +31,11 @@ def start_server(function): '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')) + self.ui.debug('(starting inotify server)\n') try: try: - server.start(self.ui, self.dirstate, self.root) + server.start(self.ui, self.dirstate, self.root, + dict(daemon=True, daemon_pipefds='')) except server.AlreadyStartedException, inst: # another process may have started its own # inotify server while this one was starting. @@ -50,7 +51,7 @@ def start_server(function): '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')) + self.ui.debug('(inotify server not running)\n') else: self.ui.warn(_('failed to contact inotify server: %s\n') % err[-1]) diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py --- a/hgext/inotify/server.py +++ b/hgext/inotify/server.py @@ -7,7 +7,7 @@ # GNU General Public License version 2, incorporated herein by reference. from mercurial.i18n import _ -from mercurial import osutil, util +from mercurial import cmdutil, osutil, util import common import errno, os, select, socket, stat, struct, sys, tempfile, time @@ -823,52 +823,29 @@ class master(object): sys.exit(0) pollable.run() -def start(ui, dirstate, root): - def closefds(ignore): - # (from python bug #1177468) - # close all inherited file descriptors - # Python 2.4.1 and later use /dev/urandom to seed the random module's RNG - # a file descriptor is kept internally as os._urandomfd (created on demand - # the first time os.urandom() is called), and should not be closed - try: - os.urandom(4) - urandom_fd = getattr(os, '_urandomfd', None) - except AttributeError: - urandom_fd = None - ignore.append(urandom_fd) - for fd in range(3, 256): - if fd in ignore: - continue +def start(ui, dirstate, root, opts): + timeout = opts.get('timeout') + if timeout: + timeout = float(timeout) * 1e3 + + class service(object): + def init(self): try: - os.close(fd) - except OSError: - pass - - m = master(ui, dirstate, root) - sys.stdout.flush() - sys.stderr.flush() + self.master = master(ui, dirstate, root, timeout) + except AlreadyStartedException, inst: + raise util.Abort(str(inst)) - pid = os.fork() - if pid: - return pid - - closefds(pollable.instances.keys()) - os.setsid() - - fd = os.open('/dev/null', os.O_RDONLY) - os.dup2(fd, 0) - if fd > 0: - os.close(fd) + def run(self): + try: + self.master.run() + finally: + self.master.shutdown() - fd = os.open(ui.config('inotify', 'log', '/dev/null'), - os.O_RDWR | os.O_CREAT | os.O_TRUNC) - os.dup2(fd, 1) - os.dup2(fd, 2) - if fd > 2: - os.close(fd) + runargs = None + if 'inserve' not in sys.argv: + runargs = [sys.argv[0], 'inserve', '-R', root] - try: - m.run() - finally: - m.shutdown() - os._exit(0) + service = service() + logfile = ui.config('inotify', 'log') + cmdutil.service(opts, initfn=service.init, runfn=service.run, + logfile=logfile, runargs=runargs) diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -244,12 +244,14 @@ class kwfilelog(filelog.filelog): return t2 != text return revlog.revlog.cmp(self, node, text) -def _status(ui, repo, kwt, unknown, *pats, **opts): +def _status(ui, repo, kwt, *pats, **opts): '''Bails out if [keyword] configuration is not active. Returns status of working directory.''' if kwt: - match = cmdutil.match(repo, pats, opts) - return repo.status(match=match, unknown=unknown, clean=True) + unknown = (opts.get('unknown') or opts.get('all') + or opts.get('untracked')) + return repo.status(match=cmdutil.match(repo, pats, opts), clean=True, + unknown=unknown) if ui.configitems('keyword'): raise util.Abort(_('[keyword] patterns cannot match')) raise util.Abort(_('no [keyword] patterns configured')) @@ -259,7 +261,7 @@ def _kwfwrite(ui, repo, expand, *pats, * if repo.dirstate.parents()[1] != nullid: raise util.Abort(_('outstanding uncommitted merge')) kwt = kwtools['templater'] - status = _status(ui, repo, kwt, False, *pats, **opts) + status = _status(ui, repo, kwt, *pats, **opts) modified, added, removed, deleted = status[:4] if modified or added or removed or deleted: raise util.Abort(_('outstanding uncommitted changes')) @@ -354,7 +356,7 @@ def demo(ui, repo, *args, **opts): repo.commit(text=msg) ui.status(_('\n\tkeywords expanded\n')) ui.write(repo.wread(fn)) - ui.debug(_('\nremoving temporary repository %s\n') % tmpdir) + ui.debug('\nremoving temporary repository %s\n' % tmpdir) shutil.rmtree(tmpdir, ignore_errors=True) def expand(ui, repo, *pats, **opts): @@ -380,30 +382,32 @@ def files(ui, repo, *pats, **opts): See "hg help keyword" on how to construct patterns both for inclusion and exclusion of files. - Use -u/--untracked to list untracked files as well. - - With -a/--all and -v/--verbose the codes used to show the status + With -A/--all and -v/--verbose the codes used to show the status of files are:: K = keyword expansion candidate - k = keyword expansion candidate (untracked) + k = keyword expansion candidate (not tracked) I = ignored - i = ignored (untracked) + i = ignored (not tracked) ''' kwt = kwtools['templater'] - status = _status(ui, repo, kwt, opts.get('untracked'), *pats, **opts) + status = _status(ui, repo, kwt, *pats, **opts) + cwd = pats and repo.getcwd() or '' modified, added, removed, deleted, unknown, ignored, clean = status - files = sorted(modified + added + clean) + files = [] + if not (opts.get('unknown') or opts.get('untracked')) or opts.get('all'): + files = sorted(modified + added + clean) wctx = repo[None] kwfiles = [f for f in files if kwt.iskwfile(f, wctx.flags)] - kwuntracked = [f for f in unknown if kwt.iskwfile(f, wctx.flags)] - cwd = pats and repo.getcwd() or '' - kwfstats = (not opts.get('ignore') and - (('K', kwfiles), ('k', kwuntracked),) or ()) + kwunknown = [f for f in unknown if kwt.iskwfile(f, wctx.flags)] + if not opts.get('ignore') or opts.get('all'): + showfiles = kwfiles, kwunknown + else: + showfiles = [], [] if opts.get('all') or opts.get('ignore'): - kwfstats += (('I', [f for f in files if f not in kwfiles]), - ('i', [f for f in unknown if f not in kwuntracked]),) - for char, filenames in kwfstats: + showfiles += ([f for f in files if f not in kwfiles], + [f for f in unknown if f not in kwunknown]) + for char, filenames in zip('KkIi', showfiles): fmt = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n' for f in filenames: ui.write(fmt % repo.pathto(f, cwd)) @@ -545,9 +549,12 @@ cmdtable = { _('hg kwexpand [OPTION]... [FILE]...')), 'kwfiles': (files, - [('a', 'all', None, _('show keyword status flags of all files')), + [('A', 'all', None, _('show keyword status flags of all files')), ('i', 'ignore', None, _('show files excluded from expansion')), - ('u', 'untracked', None, _('additionally show untracked files')), + ('u', 'unknown', None, _('only show unknown (not tracked) files')), + ('a', 'all', None, + _('show keyword status flags of all files (DEPRECATED)')), + ('u', 'untracked', None, _('only show untracked files (DEPRECATED)')), ] + commands.walkopts, _('hg kwfiles [OPTION]... [FILE]...')), 'kwshrink': (shrink, commands.walkopts, diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -321,7 +321,7 @@ class queue(object): if bad: raise util.Abort(bad) guards = sorted(set(guards)) - self.ui.debug(_('active guards: %s\n') % ' '.join(guards)) + self.ui.debug('active guards: %s\n' % ' '.join(guards)) self.active_guards = guards self.guards_dirty = True @@ -997,6 +997,8 @@ class queue(object): self.ui.warn(_('done\n')) raise + if not self.applied: + return ret[0] top = self.applied[-1].name if ret[0] and ret[0] > 1: msg = _("errors during apply, please fix and refresh %s\n") @@ -2618,7 +2620,7 @@ cmdtable = { (pop, [('a', 'all', None, _('pop all patches')), ('n', 'name', '', _('queue name to pop')), - ('f', 'force', None, _('forget any local changes'))], + ('f', 'force', None, _('forget any local changes to patched files'))], _('hg qpop [-a] [-n NAME] [-f] [PATCH | INDEX]')), "^qpush": (push, diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -43,6 +43,7 @@ Optional configuration items:: diffstat = True # add a diffstat before the diff content sources = serve # notify if source of incoming changes in this list # (serve == ssh or http, push, pull, bundle) + merge = False # send notification for merges (default True) [email] from = user@host.com # email address to send as if none given [web] @@ -111,6 +112,7 @@ class notifier(object): self.test = self.ui.configbool('notify', 'test', True) self.charsets = mail._charsets(self.ui) self.subs = self.subscribers() + self.merge = self.ui.configbool('notify', 'merge', True) mapfile = self.ui.config('notify', 'style') template = (self.ui.config('notify', hooktype) or @@ -165,11 +167,14 @@ class notifier(object): def url(self, path=None): return self.ui.config('web', 'baseurl') + (path or self.root) - def node(self, ctx): - '''format one changeset.''' + def node(self, ctx, **props): + '''format one changeset, unless it is a suppressed merge.''' + if not self.merge and len(ctx.parents()) > 1: + return False self.t.show(ctx, changes=ctx.changeset(), baseurl=self.ui.config('web', 'baseurl'), - root=self.repo.root, webroot=self.root) + root=self.repo.root, webroot=self.root, **props) + return True def skipsource(self, source): '''true if incoming changes from this source should be skipped.''' @@ -276,23 +281,36 @@ def hook(ui, repo, hooktype, node=None, ctx = repo[node] if not n.subs: - ui.debug(_('notify: no subscribers to repository %s\n') % n.root) + ui.debug('notify: no subscribers to repository %s\n' % n.root) return if n.skipsource(source): - ui.debug(_('notify: changes have source "%s" - skipping\n') % source) + ui.debug('notify: changes have source "%s" - skipping\n' % source) return ui.pushbuffer() + data = '' + count = 0 if hooktype == 'changegroup': start, end = ctx.rev(), len(repo) - count = end - start for rev in xrange(start, end): - n.node(repo[rev]) - n.diff(ctx, repo['tip']) + if n.node(repo[rev]): + count += 1 + else: + data += ui.popbuffer() + ui.note(_('notify: suppressing notification for merge %d:%s\n') % + (rev, repo[rev].hex()[:12])) + ui.pushbuffer() + if count: + n.diff(ctx, repo['tip']) else: - count = 1 - n.node(ctx) + if not n.node(ctx): + ui.popbuffer() + ui.note(_('notify: suppressing notification for merge %d:%s\n') % + (ctx.rev(), ctx.hex()[:12])) + return + count += 1 n.diff(ctx) - data = ui.popbuffer() - n.send(ctx, count, data) + data += ui.popbuffer() + if count: + n.send(ctx, count, data) diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -35,7 +35,7 @@ def rebasemerge(repo, rev, first=False): if not first: ancestor.ancestor = newancestor else: - repo.ui.debug(_("first revision, do not change ancestor\n")) + repo.ui.debug("first revision, do not change ancestor\n") stats = merge.update(repo, rev, True, True, False) return stats @@ -149,7 +149,7 @@ def concludenode(repo, rev, p1, p2, stat """Skip commit if collapsing has been required and rev is not the last revision, commit otherwise """ - repo.ui.debug(_(" set parents\n")) + repo.ui.debug(" set parents\n") if collapse and not last: repo.dirstate.setparents(repo[p1].node()) return None @@ -187,23 +187,23 @@ def concludenode(repo, rev, p1, p2, stat def rebasenode(repo, rev, target, state, skipped, targetancestors, collapse, extrafn): 'Rebase a single revision' - repo.ui.debug(_("rebasing %d:%s\n") % (rev, repo[rev])) + repo.ui.debug("rebasing %d:%s\n" % (rev, repo[rev])) p1, p2 = defineparents(repo, rev, target, state, targetancestors) - repo.ui.debug(_(" future parents are %d and %d\n") % (repo[p1].rev(), + repo.ui.debug(" future parents are %d and %d\n" % (repo[p1].rev(), repo[p2].rev())) # Merge phase if len(repo.parents()) != 2: # Update to target and merge it with local if repo['.'].rev() != repo[p1].rev(): - repo.ui.debug(_(" update to %d:%s\n") % (repo[p1].rev(), repo[p1])) + repo.ui.debug(" update to %d:%s\n" % (repo[p1].rev(), repo[p1])) merge.update(repo, p1, False, True, False) else: - repo.ui.debug(_(" already in target\n")) + repo.ui.debug(" already in target\n") repo.dirstate.write() - repo.ui.debug(_(" merge against %d:%s\n") % (repo[rev].rev(), repo[rev])) + repo.ui.debug(" merge against %d:%s\n" % (repo[rev].rev(), repo[rev])) first = repo[rev].rev() == repo[min(state)].rev() stats = rebasemerge(repo, rev, first) @@ -211,7 +211,7 @@ def rebasenode(repo, rev, target, state, raise util.Abort(_('fix unresolved conflicts with hg resolve then ' 'run hg rebase --continue')) else: # we have an interrupted rebase - repo.ui.debug(_('resuming interrupted rebase\n')) + repo.ui.debug('resuming interrupted rebase\n') # Keep track of renamed files in the revision that is going to be rebased # Here we simulate the copies and renames in the source changeset @@ -234,7 +234,7 @@ def rebasenode(repo, rev, target, state, else: if not collapse: repo.ui.note(_('no changes, revision %d skipped\n') % rev) - repo.ui.debug(_('next revision set to %s\n') % p1) + repo.ui.debug('next revision set to %s\n' % p1) skipped.add(rev) state[rev] = p1 @@ -280,7 +280,7 @@ def updatemq(repo, state, skipped, **opt mqrebase = {} for p in repo.mq.applied: if repo[p.rev].rev() in state: - repo.ui.debug(_('revision %d is an mq patch (%s), finalize it.\n') % + repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' % (repo[p.rev].rev(), p.name)) mqrebase[repo[p.rev].rev()] = (p.name, isagitpatch(repo, p.name)) @@ -290,7 +290,7 @@ def updatemq(repo, state, skipped, **opt # We must start import from the newest revision for rev in sorted(mqrebase, reverse=True): if rev not in skipped: - repo.ui.debug(_('import mq patch %d (%s)\n') + repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], mqrebase[rev][0])) repo.mq.qimport(repo, (), patchname=mqrebase[rev][0], git=mqrebase[rev][1],rev=[str(state[rev])]) @@ -311,7 +311,7 @@ def storestatus(repo, originalwd, target newrev = repo[v].hex() f.write("%s:%s\n" % (oldrev, newrev)) f.close() - repo.ui.debug(_('rebase status stored\n')) + repo.ui.debug('rebase status stored\n') def clearstatus(repo): 'Remove the status files' @@ -342,7 +342,7 @@ def restorestatus(repo): else: oldrev, newrev = l.split(':') state[repo[oldrev].rev()] = repo[newrev].rev() - repo.ui.debug(_('rebase status resumed\n')) + repo.ui.debug('rebase status resumed\n') return originalwd, target, state, collapse, keep, keepbranches, external except IOError, err: if err.errno != errno.ENOENT: @@ -381,9 +381,9 @@ def buildstate(repo, dest, src, base, co if src: commonbase = repo[src].ancestor(repo[dest]) if commonbase == repo[src]: - raise util.Abort(_('cannot rebase an ancestor')) + raise util.Abort(_('source is ancestor of destination')) if commonbase == repo[dest]: - raise util.Abort(_('cannot rebase a descendant')) + raise util.Abort(_('source is descendant of destination')) source = repo[src].rev() else: if base: @@ -392,20 +392,24 @@ def buildstate(repo, dest, src, base, co cwd = repo['.'].rev() if cwd == dest: - repo.ui.debug(_('already working on current\n')) + repo.ui.debug('source and destination are the same\n') return None targetancestors = set(repo.changelog.ancestors(dest)) if cwd in targetancestors: - repo.ui.debug(_('already working on the current branch\n')) + repo.ui.debug('source is ancestor of destination\n') return None cwdancestors = set(repo.changelog.ancestors(cwd)) + if dest in cwdancestors: + repo.ui.debug('source is descendant of destination\n') + return None + cwdancestors.add(cwd) rebasingbranch = cwdancestors - targetancestors source = min(rebasingbranch) - repo.ui.debug(_('rebase onto %d starting from %d\n') % (dest, source)) + repo.ui.debug('rebase onto %d starting from %d\n' % (dest, source)) state = dict.fromkeys(repo.changelog.descendants(source), nullrev) external = nullrev if collapse: @@ -429,8 +433,8 @@ def pullrebase(orig, ui, repo, *args, ** if opts.get('rebase'): if opts.get('update'): del opts['update'] - ui.debug(_('--update and --rebase are not compatible, ignoring ' - 'the update flag\n')) + ui.debug('--update and --rebase are not compatible, ignoring ' + 'the update flag\n') cmdutil.bail_if_changed(repo) revsprepull = len(repo) @@ -460,9 +464,9 @@ cmdtable = { ('s', 'source', '', _('rebase from a given revision')), ('b', 'base', '', _('rebase from the base of a given revision')), ('d', 'dest', '', _('rebase onto a given revision')), - ('', 'collapse', False, _('collapse the rebased revisions')), - ('', 'keep', False, _('keep original revisions')), - ('', 'keepbranches', False, _('keep original branches')), + ('', 'collapse', False, _('collapse the rebased changesets')), + ('', 'keep', False, _('keep original changesets')), + ('', 'keepbranches', False, _('keep original branch names')), ('c', 'continue', False, _('continue an interrupted rebase')), ('a', 'abort', False, _('abort an interrupted rebase')),] + templateopts, diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -463,7 +463,7 @@ def dorecord(ui, repo, committer, *pats, fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.', dir=backupdir) os.close(fd) - ui.debug(_('backup %r as %r\n') % (f, tmpname)) + ui.debug('backup %r as %r\n' % (f, tmpname)) util.copyfile(repo.wjoin(f), tmpname) backups[f] = tmpname @@ -481,7 +481,7 @@ def dorecord(ui, repo, committer, *pats, # 3b. (apply) if dopatch: try: - ui.debug(_('applying patch\n')) + ui.debug('applying patch\n') ui.debug(fp.getvalue()) pfiles = {} patch.internalpatch(fp, ui, 1, repo.root, files=pfiles, @@ -512,7 +512,7 @@ def dorecord(ui, repo, committer, *pats, # 5. finally restore backed-up files try: for realname, tmpname in backups.iteritems(): - ui.debug(_('restoring %r to %r\n') % (tmpname, realname)) + ui.debug('restoring %r to %r\n' % (tmpname, realname)) util.copyfile(tmpname, repo.wjoin(realname)) os.unlink(tmpname) os.rmdir(backupdir) diff --git a/hgext/win32mbcs.py b/hgext/win32mbcs.py --- a/hgext/win32mbcs.py +++ b/hgext/win32mbcs.py @@ -142,6 +142,6 @@ def reposetup(ui, repo): for f in funcs.split(): wrapname(f, wrapper) wrapname("mercurial.osutil.listdir", wrapperforlistdir) - ui.debug(_("[win32mbcs] activated with encoding: %s\n") + ui.debug("[win32mbcs] activated with encoding: %s\n" % encoding.encoding) diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py --- a/hgext/zeroconf/__init__.py +++ b/hgext/zeroconf/__init__.py @@ -109,12 +109,13 @@ class hgwebdirzc(hgwebdir_mod.hgwebdir): def __init__(self, conf, baseui=None): super(hgwebdirzc, self).__init__(conf, baseui) prefix = self.ui.config("web", "prefix", "").strip('/') + '/' - for r, p in self.repos: + for repo, path in self.repos: u = self.ui.copy() - u.readconfig(os.path.join(p, '.hg', 'hgrc')) - n = os.path.basename(r) - path = (prefix + r).strip('/') - publish(n, "hgweb", path, int(u.config("web", "port", 8000))) + u.readconfig(os.path.join(path, '.hg', 'hgrc')) + name = os.path.basename(repo) + path = (prefix + repo).strip('/') + desc = u.config('web', 'description', name) + publish(name, desc, path, int(u.config("web", "port", 8000))) # listen @@ -136,25 +137,24 @@ def getzcpaths(): Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l) time.sleep(1) server.close() - for v in l.found.values(): - n = v.name[:v.name.index('.')] - n.replace(" ", "-") - u = "http://%s:%s%s" % (socket.inet_ntoa(v.address), v.port, - v.properties.get("path", "/")) - yield "zc-" + n, u + for value in l.found.values(): + name = value.name[:value.name.index('.')] + url = "http://%s:%s%s" % (socket.inet_ntoa(value.address), value.port, + value.properties.get("path", "/")) + yield "zc-" + name, url def config(orig, self, section, key, default=None, untrusted=False): if section == "paths" and key.startswith("zc-"): - for n, p in getzcpaths(): - if n == key: - return p + for name, path in getzcpaths(): + if name == key: + return path return orig(self, section, key, default, untrusted) def configitems(orig, self, section, untrusted=False): - r = orig(self, section, untrusted) + repos = orig(self, section, untrusted) if section == "paths": - r += getzcpaths() - return r + repos += getzcpaths() + return repos extensions.wrapfunction(ui.ui, 'config', config) extensions.wrapfunction(ui.ui, 'configitems', configitems) diff --git a/i18n/da.po b/i18n/da.po --- a/i18n/da.po +++ b/i18n/da.po @@ -17,8 +17,8 @@ msgid "" msgstr "" "Project-Id-Version: Mercurial\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-20 23:05+0200\n" -"PO-Revision-Date: 2009-07-21 00:18+0200\n" +"POT-Creation-Date: 2009-09-29 00:26+0200\n" +"PO-Revision-Date: 2009-09-29 00:41+0200\n" "Last-Translator: \n" "Language-Team: Danish\n" "MIME-Version: 1.0\n" @@ -36,8 +36,12 @@ msgstr "TILVALG" msgid "COMMANDS" msgstr "KOMMANDOER" -msgid " options:\n" -msgstr " tilvalg:\n" +msgid "" +" options:\n" +"\n" +msgstr "" +" tilvalg:\n" +"\n" #, python-format msgid "" @@ -64,7 +68,7 @@ msgid "" "Nor is it safe if remote users share an account, because then there\n" "is no way to distinguish them.\n" "\n" -"To use this hook, configure the acl extension in your hgrc like this:\n" +"To use this hook, configure the acl extension in your hgrc like this::\n" "\n" " [extensions]\n" " hgext.acl =\n" @@ -77,10 +81,10 @@ msgid "" " # (\"serve\" == ssh or http, \"push\", \"pull\", \"bundle\")\n" " sources = serve\n" "\n" -"The allow and deny sections take a subtree pattern as key (with a\n" -"glob syntax by default), and a comma separated list of users as\n" -"the corresponding value. The deny list is checked before the allow\n" -"list is.\n" +"The allow and deny sections take a subtree pattern as key (with a glob\n" +"syntax by default), and a comma separated list of users as the\n" +"corresponding value. The deny list is checked before the allow list\n" +"is. ::\n" "\n" " [acl.allow]\n" " # If acl.allow is not present, all users are allowed by default.\n" @@ -133,16 +137,16 @@ msgid "" "\n" "Bookmarks are local movable markers to changesets. Every bookmark\n" "points to a changeset identified by its hash. If you commit a\n" -"changeset that is based on a changeset that has a bookmark on it,\n" -"the bookmark shifts to the new changeset.\n" -"\n" -"It is possible to use bookmark names in every revision lookup\n" -"(e.g. hg merge, hg update).\n" +"changeset that is based on a changeset that has a bookmark on it, the\n" +"bookmark shifts to the new changeset.\n" +"\n" +"It is possible to use bookmark names in every revision lookup (e.g. hg\n" +"merge, hg update).\n" "\n" "By default, when several bookmarks point to the same changeset, they\n" "will all move forward together. It is possible to obtain a more\n" "git-like experience by adding the following configuration option to\n" -"your .hgrc:\n" +"your .hgrc::\n" "\n" " [bookmarks]\n" " track.current = True\n" @@ -217,65 +221,86 @@ msgid "" "be run by Mercurial as the user pushing the change; you will need to\n" "ensure the Bugzilla install file permissions are set appropriately.\n" "\n" -"Configuring the extension:\n" -"\n" -" [bugzilla]\n" -"\n" -" host Hostname of the MySQL server holding the Bugzilla\n" -" database.\n" -" db Name of the Bugzilla database in MySQL. Default 'bugs'.\n" -" user Username to use to access MySQL server. Default 'bugs'.\n" -" password Password to use to access MySQL server.\n" -" timeout Database connection timeout (seconds). Default 5.\n" -" version Bugzilla version. Specify '3.0' for Bugzilla versions\n" -" 3.0 and later, '2.18' for Bugzilla versions from 2.18\n" -" and '2.16' for versions prior to 2.18.\n" -" bzuser Fallback Bugzilla user name to record comments with, if\n" -" changeset committer cannot be found as a Bugzilla user.\n" -" bzdir Bugzilla install directory. Used by default notify.\n" -" Default '/var/www/html/bugzilla'.\n" -" notify The command to run to get Bugzilla to send bug change\n" -" notification emails. Substitutes from a map with 3\n" -" keys, 'bzdir', 'id' (bug id) and 'user' (committer\n" -" bugzilla email). Default depends on version; from 2.18\n" -" it is \"cd %(bzdir)s && perl -T contrib/sendbugmail.pl\n" -" %(id)s %(user)s\".\n" -" regexp Regular expression to match bug IDs in changeset commit\n" -" message. Must contain one \"()\" group. The default\n" -" expression matches 'Bug 1234', 'Bug no. 1234', 'Bug\n" -" number 1234', 'Bugs 1234,5678', 'Bug 1234 and 5678' and\n" -" variations thereof. Matching is case insensitive.\n" -" style The style file to use when formatting comments.\n" -" template Template to use when formatting comments. Overrides\n" -" style if specified. In addition to the usual Mercurial\n" -" keywords, the extension specifies:\n" -" {bug} The Bugzilla bug ID.\n" -" {root} The full pathname of the Mercurial\n" -" repository.\n" -" {webroot} Stripped pathname of the Mercurial\n" -" repository.\n" -" {hgweb} Base URL for browsing Mercurial\n" -" repositories.\n" -" Default 'changeset {node|short} in repo {root} refers '\n" -" 'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'\n" -" strip The number of slashes to strip from the front of {root}\n" -" to produce {webroot}. Default 0.\n" -" usermap Path of file containing Mercurial committer ID to\n" -" Bugzilla user ID mappings. If specified, the file\n" -" should contain one mapping per line,\n" -" \"committer\"=\"Bugzilla user\". See also the [usermap]\n" -" section.\n" -"\n" -" [usermap]\n" -" Any entries in this section specify mappings of Mercurial\n" -" committer ID to Bugzilla user ID. See also [bugzilla].usermap.\n" -" \"committer\"=\"Bugzilla user\"\n" -"\n" -" [web]\n" -" baseurl Base URL for browsing Mercurial repositories. Reference\n" -" from templates as {hgweb}.\n" -"\n" -"Activating the extension:\n" +"The extension is configured through three different configuration\n" +"sections. These keys are recognized in the [bugzilla] section:\n" +"\n" +"host\n" +" Hostname of the MySQL server holding the Bugzilla database.\n" +"\n" +"db\n" +" Name of the Bugzilla database in MySQL. Default 'bugs'.\n" +"\n" +"user\n" +" Username to use to access MySQL server. Default 'bugs'.\n" +"\n" +"password\n" +" Password to use to access MySQL server.\n" +"\n" +"timeout\n" +" Database connection timeout (seconds). Default 5.\n" +"\n" +"version\n" +" Bugzilla version. Specify '3.0' for Bugzilla versions 3.0 and later,\n" +" '2.18' for Bugzilla versions from 2.18 and '2.16' for versions prior\n" +" to 2.18.\n" +"\n" +"bzuser\n" +" Fallback Bugzilla user name to record comments with, if changeset\n" +" committer cannot be found as a Bugzilla user.\n" +"\n" +"bzdir\n" +" Bugzilla install directory. Used by default notify. Default\n" +" '/var/www/html/bugzilla'.\n" +"\n" +"notify\n" +" The command to run to get Bugzilla to send bug change notification\n" +" emails. Substitutes from a map with 3 keys, 'bzdir', 'id' (bug id)\n" +" and 'user' (committer bugzilla email). Default depends on version;\n" +" from 2.18 it is \"cd %(bzdir)s && perl -T contrib/sendbugmail.pl\n" +" %(id)s %(user)s\".\n" +"\n" +"regexp\n" +" Regular expression to match bug IDs in changeset commit message.\n" +" Must contain one \"()\" group. The default expression matches 'Bug\n" +" 1234', 'Bug no. 1234', 'Bug number 1234', 'Bugs 1234,5678', 'Bug\n" +" 1234 and 5678' and variations thereof. Matching is case insensitive.\n" +"\n" +"style\n" +" The style file to use when formatting comments.\n" +"\n" +"template\n" +" Template to use when formatting comments. Overrides style if\n" +" specified. In addition to the usual Mercurial keywords, the\n" +" extension specifies::\n" +"\n" +" {bug} The Bugzilla bug ID.\n" +" {root} The full pathname of the Mercurial repository.\n" +" {webroot} Stripped pathname of the Mercurial repository.\n" +" {hgweb} Base URL for browsing Mercurial repositories.\n" +"\n" +" Default 'changeset {node|short} in repo {root} refers '\n" +" 'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'\n" +"\n" +"strip\n" +" The number of slashes to strip from the front of {root} to produce\n" +" {webroot}. Default 0.\n" +"\n" +"usermap\n" +" Path of file containing Mercurial committer ID to Bugzilla user ID\n" +" mappings. If specified, the file should contain one mapping per\n" +" line, \"committer\"=\"Bugzilla user\". See also the [usermap] section.\n" +"\n" +"The [usermap] section is used to specify mappings of Mercurial\n" +"committer ID to Bugzilla user ID. See also [bugzilla].usermap.\n" +"\"committer\"=\"Bugzilla user\"\n" +"\n" +"Finally, the [web] section supports one entry:\n" +"\n" +"baseurl\n" +" Base URL for browsing Mercurial repositories. Reference from\n" +" templates as {hgweb}.\n" +"\n" +"Activating the extension::\n" "\n" " [extensions]\n" " hgext.bugzilla =\n" @@ -288,7 +313,7 @@ msgid "" "\n" "This example configuration is for a collection of Mercurial\n" "repositories in /var/local/hg/repos/ used with a local Bugzilla 3.2\n" -"installation in /opt/bugzilla-3.2.\n" +"installation in /opt/bugzilla-3.2. ::\n" "\n" " [bugzilla]\n" " host=localhost\n" @@ -296,8 +321,9 @@ msgid "" " version=3.0\n" " bzuser=unknown@domain.com\n" " bzdir=/opt/bugzilla-3.2\n" -" template=Changeset {node|short} in {root|basename}.\\n{hgweb}/{webroot}/" -"rev/{node|short}\\n\\n{desc}\\n\n" +" template=Changeset {node|short} in {root|basename}.\n" +" {hgweb}/{webroot}/rev/{node|short}\\n\n" +" {desc}\\n\n" " strip=5\n" "\n" " [web]\n" @@ -306,7 +332,7 @@ msgid "" " [usermap]\n" " user@emaildomain.com=user.name@bugzilladomain.com\n" "\n" -"Commits add a comment to the Bugzilla bug record of the form:\n" +"Commits add a comment to the Bugzilla bug record of the form::\n" "\n" " Changeset 3b16791d6642 in repository-name.\n" " http://dev.domain.com/hg/repository-name/rev/3b16791d6642\n" @@ -437,7 +463,7 @@ msgid "" " alternatively the number of matching revisions if the\n" " --changesets option is specified.\n" "\n" -" Examples:\n" +" Examples::\n" "\n" " # display count of changed lines for every committer\n" " hg churn -t '{author|email}'\n" @@ -452,12 +478,12 @@ msgid "" " hg churn -f '%Y' -s\n" "\n" " It is possible to map alternate email addresses to a main address\n" -" by providing a file using the following format:\n" -"\n" -" \n" -"\n" -" Such a file may be specified with the --aliases option, otherwise a\n" -" .hgchurn file will be looked for in the working directory root.\n" +" by providing a file using the following format::\n" +"\n" +" \n" +"\n" +" Such a file may be specified with the --aliases option, otherwise\n" +" a .hgchurn file will be looked for in the working directory root.\n" " " msgstr "" "histogram over ændringer i depotet\n" @@ -472,7 +498,7 @@ msgstr "" " alternativt på antallet af matchende revisioner, hvis --changesets\n" " tilvalget er specificeret.\n" "\n" -" Eksempler:\n" +" Eksempler::\n" "\n" " # viser antaller af ændrede linier for hver bruger\n" " hg churn -t '{author|email}'\n" @@ -487,9 +513,9 @@ msgstr "" " hg churn -f '%Y' -s\n" "\n" " Det er muligt at afbilde alternative e-mail-adresser til\n" -" hoved-adresser ved at bruge en fil med følgende format:\n" -"\n" -" \n" +" hoved-adresser ved at bruge en fil med følgende format::\n" +"\n" +" \n" "\n" " En sådan fil kan angivet med --aliases tilvalget. Som standard\n" " bruges .hgchurn i arbejdskatalogets rod, hvis denne findes.\n" @@ -540,33 +566,33 @@ msgid "" "function (aka ANSI escape codes). This module also provides the\n" "render_text function, which can be used to add effects to any text.\n" "\n" -"Default effects may be overridden from the .hgrc file:\n" -"\n" -"[color]\n" -"status.modified = blue bold underline red_background\n" -"status.added = green bold\n" -"status.removed = red bold blue_background\n" -"status.deleted = cyan bold underline\n" -"status.unknown = magenta bold underline\n" -"status.ignored = black bold\n" -"\n" -"# 'none' turns off all effects\n" -"status.clean = none\n" -"status.copied = none\n" -"\n" -"qseries.applied = blue bold underline\n" -"qseries.unapplied = black bold\n" -"qseries.missing = red bold\n" -"\n" -"diff.diffline = bold\n" -"diff.extended = cyan bold\n" -"diff.file_a = red bold\n" -"diff.file_b = green bold\n" -"diff.hunk = magenta\n" -"diff.deleted = red\n" -"diff.inserted = green\n" -"diff.changed = white\n" -"diff.trailingwhitespace = bold red_background\n" +"Default effects may be overridden from the .hgrc file::\n" +"\n" +" [color]\n" +" status.modified = blue bold underline red_background\n" +" status.added = green bold\n" +" status.removed = red bold blue_background\n" +" status.deleted = cyan bold underline\n" +" status.unknown = magenta bold underline\n" +" status.ignored = black bold\n" +"\n" +" # 'none' turns off all effects\n" +" status.clean = none\n" +" status.copied = none\n" +"\n" +" qseries.applied = blue bold underline\n" +" qseries.unapplied = black bold\n" +" qseries.missing = red bold\n" +"\n" +" diff.diffline = bold\n" +" diff.extended = cyan bold\n" +" diff.file_a = red bold\n" +" diff.file_b = green bold\n" +" diff.hunk = magenta\n" +" diff.deleted = red\n" +" diff.inserted = green\n" +" diff.changed = white\n" +" diff.trailingwhitespace = bold red_background\n" msgstr "" msgid "when to colorize (always, auto, or never)" @@ -586,6 +612,7 @@ msgid "" "convert a foreign SCM repository to a Mercurial one.\n" "\n" " Accepted source formats [identifiers]:\n" +"\n" " - Mercurial [hg]\n" " - CVS [cvs]\n" " - Darcs [darcs]\n" @@ -597,6 +624,7 @@ msgid "" " - Perforce [p4]\n" "\n" " Accepted destination formats [identifiers]:\n" +"\n" " - Mercurial [hg]\n" " - Subversion [svn] (history on branches is not preserved)\n" "\n" @@ -608,23 +636,28 @@ msgid "" " basename of the source with '-hg' appended. If the destination\n" " repository doesn't exist, it will be created.\n" "\n" -" By default, all sources except Mercurial will use\n" -" --branchsort. Mercurial uses --sourcesort to preserve original\n" -" revision numbers order. Sort modes have the following effects:\n" -" --branchsort: convert from parent to child revision when\n" -" possible, which means branches are usually converted one after\n" -" the other. It generates more compact repositories.\n" -" --datesort: sort revisions by date. Converted repositories have\n" -" good-looking changelogs but are often an order of magnitude\n" -" larger than the same ones generated by --branchsort.\n" -" --sourcesort: try to preserve source revisions order, only\n" -" supported by Mercurial sources.\n" +" By default, all sources except Mercurial will use --branchsort.\n" +" Mercurial uses --sourcesort to preserve original revision numbers\n" +" order. Sort modes have the following effects:\n" +"\n" +" --branchsort convert from parent to child revision when possible,\n" +" which means branches are usually converted one after\n" +" the other. It generates more compact repositories.\n" +"\n" +" --datesort sort revisions by date. Converted repositories have\n" +" good-looking changelogs but are often an order of\n" +" magnitude larger than the same ones generated by\n" +" --branchsort.\n" +"\n" +" --sourcesort try to preserve source revisions order, only\n" +" supported by Mercurial sources.\n" "\n" " If isn't given, it will be put in a default location\n" " (/.hg/shamap by default). The is a simple text file\n" " that maps each source commit ID to the destination ID for that\n" -" revision, like so:\n" -" \n" +" revision, like so::\n" +"\n" +" \n" "\n" " If the file doesn't exist, it's automatically created. It's\n" " updated on each commit copied, so convert-repo can be interrupted\n" @@ -638,7 +671,7 @@ msgid "" "\n" " The filemap is a file that allows filtering and remapping of files\n" " and directories. Comment lines start with '#'. Each line can\n" -" contain one of the following directives:\n" +" contain one of the following directives::\n" "\n" " include path/to/file\n" "\n" @@ -648,11 +681,11 @@ msgid "" "\n" " The 'include' directive causes a file, or all files under a\n" " directory, to be included in the destination repository, and the\n" -" exclusion of all other files and directories not explicitly included.\n" -" The 'exclude' directive causes files or directories to be omitted.\n" -" The 'rename' directive renames a file or directory. To rename from\n" -" a subdirectory into the root of the repository, use '.' as the\n" -" path to rename to.\n" +" exclusion of all other files and directories not explicitly\n" +" included. The 'exclude' directive causes files or directories to\n" +" be omitted. The 'rename' directive renames a file or directory. To\n" +" rename from a subdirectory into the root of the repository, use\n" +" '.' as the path to rename to.\n" "\n" " The splicemap is a file that allows insertion of synthetic\n" " history, letting you specify the parents of a revision. This is\n" @@ -677,7 +710,7 @@ msgid "" " in one repository from \"default\" to a named branch.\n" "\n" " Mercurial Source\n" -" -----------------\n" +" ----------------\n" "\n" " --config convert.hg.ignoreerrors=False (boolean)\n" " ignore integrity errors when reading. Use it to fix Mercurial\n" @@ -705,36 +738,38 @@ msgid "" " Because CVS does not have changesets, it is necessary to collect\n" " individual commits to CVS and merge them into changesets. CVS\n" " source uses its internal changeset merging code by default but can\n" -" be configured to call the external 'cvsps' program by setting:\n" -" --config convert.cvsps='cvsps -A -u --cvs-direct -q'\n" +" be configured to call the external 'cvsps' program by setting::\n" +"\n" +" --config convert.cvsps='cvsps -A -u --cvs-direct -q'\n" +"\n" " This option is deprecated and will be removed in Mercurial 1.4.\n" "\n" " The options shown are the defaults.\n" "\n" -" Internal cvsps is selected by setting\n" -" --config convert.cvsps=builtin\n" +" Internal cvsps is selected by setting ::\n" +"\n" +" --config convert.cvsps=builtin\n" +"\n" " and has a few more configurable options:\n" -" --config convert.cvsps.cache=True (boolean)\n" -" Set to False to disable remote log caching, for testing and\n" -" debugging purposes.\n" -" --config convert.cvsps.fuzz=60 (integer)\n" -" Specify the maximum time (in seconds) that is allowed\n" -" between commits with identical user and log message in a\n" -" single changeset. When very large files were checked in as\n" -" part of a changeset then the default may not be long\n" -" enough.\n" -" --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}'\n" -" Specify a regular expression to which commit log messages\n" -" are matched. If a match occurs, then the conversion\n" -" process will insert a dummy revision merging the branch on\n" -" which this log message occurs to the branch indicated in\n" -" the regex.\n" -" --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}'\n" -" Specify a regular expression to which commit log messages\n" -" are matched. If a match occurs, then the conversion\n" -" process will add the most recent revision on the branch\n" -" indicated in the regex as the second parent of the\n" -" changeset.\n" +"\n" +" --config convert.cvsps.cache=True (boolean)\n" +" Set to False to disable remote log caching, for testing and\n" +" debugging purposes.\n" +" --config convert.cvsps.fuzz=60 (integer)\n" +" Specify the maximum time (in seconds) that is allowed between\n" +" commits with identical user and log message in a single\n" +" changeset. When very large files were checked in as part of a\n" +" changeset then the default may not be long enough.\n" +" --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}'\n" +" Specify a regular expression to which commit log messages are\n" +" matched. If a match occurs, then the conversion process will\n" +" insert a dummy revision merging the branch on which this log\n" +" message occurs to the branch indicated in the regex.\n" +" --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}'\n" +" Specify a regular expression to which commit log messages are\n" +" matched. If a match occurs, then the conversion process will\n" +" add the most recent revision on the branch indicated in the\n" +" regex as the second parent of the changeset.\n" "\n" " The hgext/convert/cvsps wrapper script allows the builtin\n" " changeset merging code to be run without doing a conversion. Its\n" @@ -784,7 +819,6 @@ msgid "" " --config convert.p4.startrev=0 (perforce changelist number)\n" " specify initial Perforce revision.\n" "\n" -"\n" " Mercurial Destination\n" " ---------------------\n" "\n" @@ -1007,7 +1041,8 @@ msgstr "CVS pserver godkendelse fejlede" #, python-format msgid "" "unexpected response from CVS server (expected \"Valid-requests\", but got %r)" -msgstr "uventet svar fra CVS serveren (forventede \"Valid-requests\", men fik %r)" +msgstr "" +"uventet svar fra CVS serveren (forventede \"Valid-requests\", men fik %r)" #, python-format msgid "%d bytes missing from remote file" @@ -1086,6 +1121,10 @@ msgstr "" msgid "%d changeset entries\n" msgstr "%d ændringer\n" +#, python-format +msgid "darcs version 2.1 or newer needed (found %r)" +msgstr "" + msgid "Python ElementTree module is not available" msgstr "Python ElementTree modulet er ikke tilstede" @@ -1330,14 +1369,14 @@ msgstr "" msgid "" "command to allow external programs to compare revisions\n" "\n" -"The `extdiff' Mercurial extension allows you to use external programs\n" -"to compare revisions, or revision with working directory. The external diff\n" -"programs are called with a configurable set of options and two\n" +"The extdiff Mercurial extension allows you to use external programs\n" +"to compare revisions, or revision with working directory. The external\n" +"diff programs are called with a configurable set of options and two\n" "non-option arguments: paths to directories containing snapshots of\n" "files to compare.\n" "\n" -"The `extdiff' extension also allows to configure new diff commands, so\n" -"you do not need to type \"hg extdiff -p kdiff3\" always.\n" +"The extdiff extension also allows to configure new diff commands, so\n" +"you do not need to type \"hg extdiff -p kdiff3\" always. ::\n" "\n" " [extdiff]\n" " # add new command that runs GNU diff(1) in 'context diff' mode\n" @@ -1353,14 +1392,13 @@ msgid "" " meld =\n" "\n" " # add new command called vimdiff, runs gvimdiff with DirDiff plugin\n" -" # (see http://www.vim.org/scripts/script.php?script_id=102)\n" -" # Non English user, be sure to put \"let g:DirDiffDynamicDiffText = 1\" " -"in\n" +" # (see http://www.vim.org/scripts/script.php?script_id=102) Non\n" +" # English user, be sure to put \"let g:DirDiffDynamicDiffText = 1\" in\n" " # your .vimrc\n" " vimdiff = gvim -f '+next' '+execute \"DirDiff\" argv(0) argv(1)'\n" "\n" "You can use -I/-X and list of file or directory names like normal \"hg\n" -"diff\" command. The `extdiff' extension makes snapshots of only needed\n" +"diff\" command. The extdiff extension makes snapshots of only needed\n" "files, so running the external diff program will actually be pretty\n" "fast (at least faster than having to compare the entire tree).\n" msgstr "" @@ -1419,6 +1457,21 @@ msgid "hg extdiff [OPT]... [FILE]..." msgstr "hg extdiff [TILVALG]... [FIL]..." #, python-format +msgid "" +"use %(path)s to diff repository (or selected files)\n" +"\n" +" Show differences between revisions for the specified files, using the\n" +" %(path)s program.\n" +"\n" +" When two revision arguments are given, then changes are shown between\n" +" those revisions. If only one revision is specified then that revision " +"is\n" +" compared to the working directory, and, when no revisions are " +"specified,\n" +" the working directory files are compared to its parent." +msgstr "" + +#, python-format msgid "hg %s [OPTION]... [FILE]..." msgstr "hg %s [TILVALG]... [FIL]..." @@ -1492,10 +1545,6 @@ msgid "merging with %d:%s\n" msgstr "sammenføjer med %d:%s\n" #, python-format -msgid "Automated merge with %s" -msgstr "Automatisk sammenføjning med %s" - -#, python-format msgid "new changeset %d:%s merges remote changes with local\n" msgstr "ny ændring %d:%s fletter fjernændringer sammen med lokale\n" @@ -1576,10 +1625,6 @@ msgstr "" "arbejdskopien af .hgsigs er ændret (deponer venligst .hgsigs manuelt eller " "brug --force)" -#, python-format -msgid "Added signature for changeset %s" -msgstr "Tilføjede underskrift af ændring %s" - msgid "unknown signature version" msgstr "ukendt underskrift-version" @@ -1655,38 +1700,38 @@ msgstr "hg glog [TILVALG]... [FIL]" msgid "" "hooks for integrating with the CIA.vc notification service\n" "\n" -"This is meant to be run as a changegroup or incoming hook.\n" -"To configure it, set the following options in your hgrc:\n" -"\n" -"[cia]\n" -"# your registered CIA user name\n" -"user = foo\n" -"# the name of the project in CIA\n" -"project = foo\n" -"# the module (subproject) (optional)\n" -"#module = foo\n" -"# Append a diffstat to the log message (optional)\n" -"#diffstat = False\n" -"# Template to use for log messages (optional)\n" -"#template = {desc}\\n{baseurl}/rev/{node}-- {diffstat}\n" -"# Style to use (optional)\n" -"#style = foo\n" -"# The URL of the CIA notification service (optional)\n" -"# You can use mailto: URLs to send by email, eg\n" -"# mailto:cia@cia.vc\n" -"# Make sure to set email.from if you do this.\n" -"#url = http://cia.vc/\n" -"# print message instead of sending it (optional)\n" -"#test = False\n" -"\n" -"[hooks]\n" -"# one of these:\n" -"changegroup.cia = python:hgcia.hook\n" -"#incoming.cia = python:hgcia.hook\n" -"\n" -"[web]\n" -"# If you want hyperlinks (optional)\n" -"baseurl = http://server/path/to/repo\n" +"This is meant to be run as a changegroup or incoming hook. To\n" +"configure it, set the following options in your hgrc::\n" +"\n" +" [cia]\n" +" # your registered CIA user name\n" +" user = foo\n" +" # the name of the project in CIA\n" +" project = foo\n" +" # the module (subproject) (optional)\n" +" #module = foo\n" +" # Append a diffstat to the log message (optional)\n" +" #diffstat = False\n" +" # Template to use for log messages (optional)\n" +" #template = {desc}\\n{baseurl}/rev/{node}-- {diffstat}\n" +" # Style to use (optional)\n" +" #style = foo\n" +" # The URL of the CIA notification service (optional)\n" +" # You can use mailto: URLs to send by email, eg\n" +" # mailto:cia@cia.vc\n" +" # Make sure to set email.from if you do this.\n" +" #url = http://cia.vc/\n" +" # print message instead of sending it (optional)\n" +" #test = False\n" +"\n" +" [hooks]\n" +" # one of these:\n" +" changegroup.cia = python:hgcia.hook\n" +" #incoming.cia = python:hgcia.hook\n" +"\n" +" [web]\n" +" # If you want hyperlinks (optional)\n" +" baseurl = http://server/path/to/repo\n" msgstr "" #, python-format @@ -1717,19 +1762,19 @@ msgid "" "\n" "The hg view command will launch the hgk Tcl script. For this command\n" "to work, hgk must be in your search path. Alternately, you can specify\n" -"the path to hgk in your .hgrc file:\n" +"the path to hgk in your .hgrc file::\n" "\n" " [hgk]\n" " path=/location/of/hgk\n" "\n" "hgk can make use of the extdiff extension to visualize revisions.\n" -"Assuming you had already configured extdiff vdiff command, just add:\n" +"Assuming you had already configured extdiff vdiff command, just add::\n" "\n" " [hgk]\n" " vdiff=vdiff\n" "\n" "Revisions context menu will now display additional entries to fire\n" -"vdiff on hovered and selected revisions." +"vdiff on hovered and selected revisions.\n" msgstr "" msgid "diff trees from two commits" @@ -1819,10 +1864,10 @@ msgid "" "It depends on the Pygments syntax highlighting library:\n" "http://pygments.org/\n" "\n" -"There is a single configuration option:\n" -"\n" -"[web]\n" -"pygments_style =