Commit Graph

16144 Commits

Author SHA1 Message Date
Yann E. MORIN
e24b85ec3e templates/filters: add doctest to the 'person' filter
Add a doctest with an hopefuly-comprehensive list of combinations
we can expect in real-life situations.

This does not cover corner cases, for example when a CR or LF is
embedded in the name (allowed by RFC 5322!).

Code in tests/test-doctest.py contributed by:
    Martin Geisler <mg@aragost.com>
Thanks!

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-03-07 01:02:12 +01:00
Yann E. MORIN
fa26f04b05 help: strip doctest from dochelp
When a dochelp string contains doctest code, the doctest
code is not stripped, so the help also displays the doctest.

Just stop parsing dochelp at the first hint of a doctest
section (starting with >>>).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-03-09 22:54:17 +01:00
Matt Mackall
cc8b3a2b01 pvec: introduce pvecs 2012-03-12 13:37:39 -05:00
Na'Tosha Bard
c51d8441de largefiles: fix check-code errors. 2012-03-09 17:11:07 +01:00
Na'Tosha Bard
65205ee295 largefiles: remove use of underscores that breaks coding convention 2012-03-09 16:11:52 +01:00
Na'Tosha Bard
a5ba0413ef largefiles: only update changed largefiles when transplanting 2012-03-09 15:26:13 +01:00
Na'Tosha Bard
064a3d8577 largefiles: move calculation of largefiles for updating to utility function 2012-03-09 16:45:49 +01:00
Matt Mackall
8cdc9fce3c posix: disable cygwin's symlink emulation 2012-03-08 15:59:47 -06:00
A. S. Budden
341d81b3bb posix: ignore execution bit in cygwin (issue3301) 2012-03-08 20:17:36 +00:00
Paul Boddie
7bbd727829 hgweb: support multi-level repository indexes by enabling descend and collapse
The descend option in hgweb can be used to display all reachable repositories
within a directory hierarchy if set to True. However, all reachable
repositories, regardless of their depth below the root of the hierarchy, are
then listed at the same level - expanded - in the hgweb interface. This patch
adds support for showing only each level of a directory hierarchy, with
subrepositories being shown alongside their parent repositories only at the
appropriate level (because there is no way to navigate to subrepositories from
within repositories), and the contents of directories hidden - collapsed -
behind a link for each directory. To enable this multi-level navigation, a new
option called collapse must be set to True when the descend option is set to
True.
2012-02-18 20:10:19 +01:00
Idan Kamara
01edf134f8 mq: no need to delete undo files after strip
repair.strip takes care of that
2012-03-06 18:43:05 +02:00
Idan Kamara
3d63e7c8f4 repair: remove undo files after strip 2012-03-06 18:43:05 +02:00
Idan Kamara
8431edb46a localrepo: refactor retrieving of journal/undo files paths
We'd like to remove undo files after stripping
2012-03-06 18:42:52 +02:00
Yann E. MORIN
14521673fb templates/filters: strip quotes from {author|person}
RFC5322 (Internet Message Format) [0] says that the 'display name' of
an internet address [1] (what Mercurial calls 'person') can be quoted
with DQUOTE (ASCII 34: ") if it contains non-atom characters [2].
For example, dot '.' is a non-atom character. Also, DQUOTEs in a
quoted string will be escaped using "\" [2][3].

The current {author|person} template+filter just extracts the part
before an email address as-is. This can look ugly, especially on the
web interface, or when generating output for post-processing...

Moreover, as an example, the Mercurial repository has a bunch of
incoherent uses of DQUOTES in author names. As per Matt's digging:

  $ hg log --template "{author|person}\n" | grep '"' | sort | uniq
  "Andrei Vermel
  "Aurelien Jacobs
  "Daniel Santa Cruz
  "Hidetaka Iwai
  "Hiroshi Funai"
  "Mathieu Clabaut
  "Paul Moore
  "Peter Arrenbrecht"
  "Rafael Villar Burke
  "Shun-ichi GOTO"
  "Wallace, Eric S"
  "Yann E. MORIN"
  Josef "Jeff" Sipek
  Radoslaw "AstralStorm" Szkodzinski

Fix the 'person' filter to remove leading and trailing DQUOTES,
and unescape remaining DQUOTES.

Given this author: "J. \"random\" DOE" <john@doe.net>
  before:   {author|person} : "J. \"random\" DOE"
  after:    {author|person} : J. "random" DOE

For the Mercurial repository, that leaves us with two authors with
DQUOTES, in acceptable positions:

  $ hg log --template "{author|person}\n" | grep '"' | sort | uniq
  Josef "Jeff" Sipek
  Radoslaw "AstralStorm" Szkodzinski

[0] https://tools.ietf.org/html/rfc5322
[1] https://tools.ietf.org/html/rfc5322#section-3.4
[2] https://tools.ietf.org/html/rfc5322#section-3.2.4
[3] https://tools.ietf.org/html/rfc5322#section-3.2.1

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-03-06 23:23:30 +01:00
Matt Mackall
bd04c54a71 check-code: check for % inside _() 2012-03-08 15:59:44 -06:00
Matt Mackall
bd8479209b patchbomb: add (optional) note to 0 of 0 prompt 2012-03-08 15:59:41 -06:00
Matt Mackall
7f2d6a6af7 merge with stable 2012-03-08 15:59:33 -06:00
Matt Mackall
f2a652218a i18n: fix all remaining uses of % inside _() 2012-03-08 13:35:27 -06:00
Javi Merino
826c30884c update: don't translate the abort message twice
The string representation of util.Abort() is translated when
merge.update() raises the exception.  For languages with characters
out of the valid ascii range, if we feed them again to i18n.gettext()
mercurial dies with:

[...]
  File "/home/javi/src/mercurial/mercurial/hg-mpm/mercurial/commands.py", line 4287, in postincoming
    ui.warn(_("not updating: %s\n" % str(inst)))
  File "/home/javi/src/mercurial/mercurial/hg-mpm/mercurial/i18n.py", line 42, in gettext
    u = u'\n\n'.join([p and t.ugettext(p) or '' for p in paragraphs])
  File "/usr/lib/python2.7/gettext.py", line 404, in ugettext
    return unicode(message)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 14: ordinal not in range(128)

To reproduce this error, just try to pull a changeset that crosses
branches with LANG=ru_RU.UTF-8
2012-03-07 23:21:11 +00:00
Matt Mackall
d1428f5d10 merge with stable 2012-03-04 17:14:30 -06:00
Matt Mackall
39e25f975a rebase: move bookmarks as needed with pull --rebase (issue3285) 2012-03-04 17:12:12 -06:00
Matt Mackall
4a144a5db5 merge with stable 2012-03-04 16:48:04 -06:00
Jim Hague
cad5cac971 bugzilla: add xmlrpcemail submission for Bugzilla 3.6 email interface
Some of the formatting details required for bug submission via email
changed between Bugzilla 3.4 and 3.6. Bugzilla 3.4 requires lines of
the form '@fieldname = value', while 3.6 wants '@fieldname value'.
Also the field @bug_id in 3.4 becomes @id in 3.6.

Bugzilla up to and including 4.0 also recognises the 3.4 format. To save
surprises in the future, check the Bugzilla version and use the 3.6
format from all major versions >= 4. At some point we will
drop support for Bugzilla prior to 3.6 and support the new format only.
2012-03-01 14:50:31 +00:00
Jim Hague
ef9d8e60cc bugzilla: allow change comment to mark bugs fixed
Add a second regular expression used when scanning change comments.
Bugs matched by this new regular expression have the bug comments and
optionally hours updated as with the first regular expression, but they
are also marked as fixed.

The bug status and resolution to set to mark a bug as fixed can be
configured. By default status is set to RESOLVED and resolution to
FIXED, the default Bugzilla settings.

For example, a change comment containing 'Fixes 1234 h1.5' will be
added to bug 1234, the bug will have its working time increased by
1.65 hours, and the bug will be marked RESOLVED/FIXED.

Change comments may contain both bug update and fix instructions. If
the same bug ID occurs in both, the last instruction found takes
precedence.

The patch adds new bug states 'bug_status' and 'resolution' and actions
to update them to the XMLRPC and XMLRPC/email access methods. XMLRPC does
not support marking bugs as fixed when used with Bugzilla versions prior
to 4.0. When used with an earlier Bugzilla version, a warning is issued
and only comment and hours updated.
2012-03-01 15:27:24 +00:00
Jim Hague
6c5c699aef bugzilla: extract optional hours from commit message and update bug time
If an 'hours' group is present in the bug matching regular expression,
and that group contains a float value, update the bug working time in
Bugzilla with those hours.

The patch adds a key 'hours' to the bug state dictionary, and adds
support for the key to the XMLRPC and XMLRPC/email access methods.
The MySQL access method is not supported; a warning is given.
2012-03-01 15:25:37 +00:00
Jim Hague
df2c50f6f8 bugzilla: modify access interface to include new bug states
As a first step to allowing comment text to update bug state, rework the
Bugzilla access interface to use a dictionary keyed on bug ID. Dictionary
entries will contain new state info in future changes.
2012-03-01 14:51:40 +00:00
Jim Hague
d51f75e5f8 bugzilla: correct comment typo 2012-03-01 14:42:23 +00:00
Javi Merino
b9abca79da tests: ignore the return code of chmod in test-inherit-mode
In freebsd, a newly created directory has the same group as the parent
directory by default.  That means that the test directory created by
test-inherit-mode.t is owned by root's group, so "chmod g+s .hg/store"
fails to set the SGID bit and returns 1.  If we ignore chmod's return
code, the testsuite passes again.
2012-03-01 23:29:52 +00:00
Steve Borho
9fbec5585f wix: add phases help text and two more translations (issue 3288) 2012-03-03 23:14:31 -06:00
Wagner Bruna
0c54f0439f debugbuilddag: fix starting a dag on a non-default branch 2012-03-02 11:46:18 -03:00
Matt Mackall
10f8ee1086 merge with i18n 2012-03-02 14:11:06 -06:00
Brendan Cully
19039ca025 setup.py: don't call splitlines twice on the output of xcodebuild (issue3277) 2012-03-02 10:42:12 -08:00
Thomas Arendsen Hein
f9c3ab24bb merge stable heads 2012-03-02 09:54:45 +01:00
Matt Mackall
4227977dfb Added signature for changeset e5aa60b60f6f 2012-03-01 16:28:24 -06:00
Thomas Arendsen Hein
d564ac8a84 filemerge: remove temporary files when using internal:dump as merge-tool 2012-03-01 17:35:12 +01:00
Idan Kamara
653ad0c355 dirstate: filecacheify _ignore (issue3278)
This still doesn't handle the case where a command is run with
--config ui.ignore=path since we only look for changes in .hgignore.
2012-03-01 17:49:59 +02:00
Idan Kamara
ca3ebc8b96 dirstate: filecacheify _branch
The opener is relative to .hg, use it in a subclass of filecache to compute
the final path.
2012-03-01 17:42:49 +02:00
Idan Kamara
8fa8539f01 dirstate: add filecache support 2012-03-01 17:39:58 +02:00
Idan Kamara
6f16e78f1f scmutil: add join method to opener to construct path relative to base
Useful when we only have the opener without the base path used when it was
constructed.
2012-03-01 17:39:58 +02:00
Idan Kamara
58bc817cd0 filecache: refactor path join logic to a function
New users of filecache use different names for the function used to compute
the runtime path of the cached file.

Users should subclass filecache and provide their own version of this
function to call the appropriate join function on 'obj' (an instance
of the class that its member function was decorated).
2012-03-01 17:39:58 +02:00
Wagner Bruna
83afbe6027 i18n-pt_BR: synchronized with 4d05b40195a0 2012-02-29 13:17:41 -03:00
Wagner Bruna
292ab80b14 merge with i18n 2012-02-29 13:16:51 -03:00
Friedrich Kastner-Masilko
b4d42dc703 subrepo: fix for merge inconsistencies
Merging ancestors with children is allowed if they are on different
named branches. This did not work for subrepo merges before. To fix
this inconsistency, the mergefunc() will now use the simple update
path only if both versions are on the same named branch. If not, they
get merged into a new changeset, just as if you did the merge from the
subrepo's root directly.
2012-02-29 14:24:57 +01:00
Pierre-Yves David
27796a9924 bundlerepo: bundle repos should be non-publishing (issue3266)
Bundle repo contains both the bundle content and the content of the repository
used as a base. This create bugs with phases exchange because the "remote"
repository claim to contains changeset it does not. The easiest way to fix this
bug is to ensure a bundle repo as non publishing. This way changeset will be
seen in the same phase than locally.

This patch does not alter in which phase bundle revision are seen. For now they
are seen as if an old client had add them on the remote: They inherit their
phase from parent whatever the parent is. This is to be fixed in a later patch
2012-02-29 14:41:11 +01:00
FUJIWARA Katsunori
c0bc4060ca i18n-ja: synchronized with ca5f5e468838 2012-02-29 21:09:21 +09:00
Gilles Moris
6e3d39e6ce bookmarks: restore python 2.4 compatibility
Remove py25 'try except finally' clause.
2012-02-29 09:34:19 +01:00
Jim Hague
dae7a893f8 bugzilla: stop XMLRPC requests from requesting gzipped responses
Python 2.7 introduced support for gzip encoding in xmlrpclib.Transport.
We do our own handling of responses, and don't currently support gzip encoding.
So to run successfully under Python 2.7 with a web server configured
to gzip encode, stop XMLRPC requests from announcing gzip encoding support.
2012-02-29 17:43:03 +00:00
Idan Kamara
263be8e6a2 update: delete bookmarks.current when explicitly updating to a rev (issue3276) 2012-02-28 23:47:46 +02:00
Patrick Mezard
a8beff44c2 convert: ignore blank lines in mapfiles (issue3286) 2012-02-28 10:06:35 +01:00
Idan Kamara
0aba016d12 update: don't move the active bookmark if a rev is specified with -r 2012-02-28 01:07:55 +02:00