sapling/mercurial
FUJIWARA Katsunori 5206a6fd25 util: replace 'ellipsis' implementation by 'encoding.trim'
Before this patch, 'util.ellipsis' tried to avoid splitting at
intermediate multi-byte sequence, but its implementation was incorrect.

Internal function '_ellipsis' trims specified unicode sequence not at
most maxlength 'columns in display', but at most maxlength number of
'unicode characters'.

    def _ellipsis(text, maxlength):
        if len(text) <= maxlength:
            return text, False
        else:
            return "%s..." % (text[:maxlength - 3]), True

In many encodings, number of unicode characters can be different from
columns in display.

This patch replaces 'ellipsis' implementation by 'encoding.trim',
which can trim string at most maxlength columns in display correctly,
even though specified string contains multi-byte characters.

'_ellipsis' is removed in this patch, because it is referred only from
'ellipsis'.
2014-07-06 02:56:41 +09:00
..
help templater: introduce word function 2014-06-12 18:02:23 -07:00
hgweb hgweb: avoid initialization race (issue4280) 2014-06-16 13:30:46 -05:00
httpclient httpclient: apply upstream revision da7579b034a4 to fix SSL problems (issue4038) 2013-09-18 14:45:28 -04:00
pure parsers: inline fields of dirstate values in C version 2014-05-27 14:27:41 -07:00
templates hgweb: apply websub filter to the changeset description in rss and atom feeds 2014-05-17 17:10:23 +08:00
__init__.py
ancestor.py ancestors: extract candidates function as commonancestorsheads 2014-04-17 19:49:56 +02:00
archival.py archive: raise error.Abort if the file pattern matches no files 2013-03-21 22:09:15 +01:00
base85.c base85: cast Py_ssize_t values to int (issue3481) 2012-06-04 16:59:34 +02:00
bdiff.c bdiff: avoid a memory error on malloc failure 2013-10-30 16:03:42 -05:00
bookmarks.py bookmarks: avoid deleting primary bookmarks on rebase 2014-07-08 14:45:55 -05:00
branchmap.py branchmap: don't use ui.warn for debug message 2014-06-23 13:50:44 -05:00
bundle2.py bundle2: gracefully handle PushRaced error during unbundle 2014-04-21 17:51:58 -07:00
bundlerepo.py bundlerepo: backout 5d87516cc668 2014-05-30 11:53:10 -07:00
byterange.py byterange: remove now-unused sys import 2013-02-09 07:44:22 -06:00
changegroup.py changegroup: use tr.hookargs when calling changegroup hooks 2014-04-17 17:46:26 -04:00
changelog.py changelog: ensure changelog._delaybuf is initialized 2014-05-20 13:55:08 -07:00
cmdutil.py cmdutil: add copy-filtering support to duplicatecopies 2014-06-07 15:14:36 -04:00
commands.py version: show enabled extensions (issue4209) 2014-06-10 13:44:37 +03:00
commandserver.py cmdserver: forcibly use L channel to read password input (issue3161) 2014-04-26 18:13:06 +09:00
config.py config: move config.sortdict class into util 2014-02-23 01:56:31 +01:00
context.py committablectx: move __contains__ into workingctx 2014-07-03 23:01:37 -05:00
copies.py copies: guard debug section with ui.debugflag 2014-02-25 20:31:53 +01:00
dagparser.py en-us: labeled 2012-08-17 13:58:18 -07:00
dagutil.py discovery: enforce filtering into revlogbaseddag._internalizeall 2013-11-15 23:27:39 -05:00
demandimport.py demandimport: make it possible to disable by setting HGDEMANDIMPORT=disable 2014-04-08 01:35:13 +02:00
dicthelpers.py dicthelpers.diff: compare against default for missing values 2013-04-10 12:31:07 -07:00
diffhelpers.c diffhelpers: use Py_ssize_t in testhunk() 2012-05-12 14:00:51 +02:00
dirs.c parsers: inline fields of dirstate values in C version 2014-05-27 14:27:41 -07:00
dirstate.py dirstate.status: assign members one by one instead of unpacking the tuple 2014-05-27 21:02:16 -07:00
discovery.py discovery: don't report all "unsynced" remote heads (issue4230) 2014-04-24 16:47:22 +02:00
dispatch.py alias: change return code of bad definition to 255 2014-05-17 15:14:18 +09:00
encoding.py encoding: add 'trim' to trim multi-byte characters at most specified columns 2014-07-06 02:56:41 +09:00
error.py bundle2: fix raising errors during heads checking 2014-04-21 18:59:09 -07:00
exchange.py push: restore contents of HG_URL for hooks (issue4268) 2014-06-18 19:46:18 -05:00
exewrapper.c exewrapper: adapt for legacy HackableMercurial 2012-08-07 11:04:41 +02:00
extensions.py version: show enabled extensions (issue4209) 2014-06-10 13:44:37 +03:00
fancyopts.py fancyopts: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:24:16 -04:00
filelog.py filelog: use super() for calling base functions 2013-05-01 10:39:37 -07:00
filemerge.py merge: drop the quotes around commit description 2014-05-26 11:44:58 -07:00
fileset.py merge with stable 2014-01-01 18:28:40 -05:00
formatter.py formatter: add condwrite method 2012-11-03 14:37:50 -05:00
graphmod.py graphmod: changed code in dagwalker to use lazy implementations 2014-03-14 08:46:46 -07:00
hbisect.py bisect: report "both good and bad" as such, not as "not directly related" 2013-11-10 18:51:21 +01:00
help.py help: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:24:24 -04:00
hg.py hg: update newly added listdir function of vfs in clone 2014-06-21 14:49:49 +05:30
hook.py hook: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:24:38 -04:00
httpconnection.py httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038) 2013-09-20 09:16:07 -04:00
httppeer.py httppeer: reintroduce _abort that accidentally was removed in fc14a1cf743e 2014-04-23 23:29:55 +02:00
i18n.py i18n: explicitly decode paragraphs 2014-06-12 14:40:45 -05:00
ignore.py ignore: process hgignore files in deterministic order 2012-12-17 15:57:02 -08:00
keepalive.py check-code: check for spaces around = for named parameters 2013-10-03 14:50:47 +02:00
localrepo.py localrepo: prevent leak of transaction object (issue4258) 2014-05-21 18:02:35 -07:00
lock.py localrepo: give a sigh of relief when getting lock after waiting for it 2014-02-06 01:55:09 +01:00
lsprof.py profiling: replace '+' markup of nested lines with indentation 2013-02-08 22:54:48 +01:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py python2.4: fix imports of sub-packages of the email package 2013-09-24 15:10:32 -04:00
manifest.py manifest: increase lrucache from 3 to 4 2013-11-11 16:35:12 -08:00
match.py match: make glob '**/' match the empty string 2014-06-25 14:50:48 -07:00
mdiff.py diff: add nobinary config to suppress git-style binary diffs 2014-06-21 15:56:49 +10:00
merge.py ancestor: silence multiple ancestor warning outside of merge (issue4234) 2014-04-30 14:19:01 -05:00
minirst.py minirst: explicitly decode substitutions 2014-06-13 14:14:02 -05:00
mpatch.c mpatch: rewrite pointer overflow checks 2013-12-11 18:33:42 -06:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
obsolete.py obsolete: fix one-element tuple in module docstring 2014-04-19 20:12:53 +02:00
osutil.c osutil: tab damage, how i hate thee 2012-12-03 13:17:01 -08:00
parser.py parser: allow passing a lookup function to a tokenizer 2014-03-18 17:17:23 -05:00
parsers.c parsers.c: fix a couple of memory leaks 2014-06-11 15:31:04 -07:00
patch.py diff: add nobinary config to suppress git-style binary diffs 2014-06-21 15:56:49 +10:00
pathencode.c pathencode: eliminate signed integer warnings 2014-02-19 13:11:24 -08:00
pathutil.py subrepo: normalize path in the specific way for problematic encodings 2014-05-08 19:03:00 +09:00
peer.py peer: delete double definition of method peer 2012-07-28 22:36:22 +02:00
phases.py phases: make order of debug output 'removing unknown node' deterministic 2014-02-20 02:43:17 +01:00
posix.py util: remove unused realpath (issue4063) 2013-12-29 13:54:04 +00:00
pushkey.py pushkey: add an `encode` function 2014-05-29 15:22:58 -07:00
pvec.py pvec: use the correct name for an identifier 2013-04-12 17:20:09 -07:00
py3kcompat.py py3kcompat: drop unused export 2014-05-13 15:22:36 -05:00
repair.py bundle2: add a ui argument to readbundle 2014-04-14 15:45:30 -04:00
repoview.py repoview: drop duplicated lookup 2014-04-13 16:39:31 -04:00
revlog.py revlog: fix check-code error 2014-06-14 11:49:02 -05:00
revset.py revset: directly use __contains__ instead of a lambda 2014-05-01 14:07:04 -07:00
scmposix.py scmutil: split platform-specific bits into their own modules 2013-02-12 11:36:21 -06:00
scmutil.py vfs: add listdir for os.listdir in vfs 2014-06-20 21:18:14 +05:30
scmwindows.py scmutil: fix NameError on windows 2013-02-21 13:16:02 -06:00
setdiscovery.py setdiscovery: document algorithms used 2014-03-06 12:37:28 +01:00
similar.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
simplemerge.py merge: prevent simplemerge from mutating label list 2014-05-08 16:33:06 -07:00
sshpeer.py sshpeer: add implementation of _calltwowaystream 2014-04-15 17:18:35 -04:00
sshserver.py localrepo: move the addchangegroup method in changegroup module 2014-04-01 15:27:53 -07:00
sslutil.py sslutil: backed out changeset 2cb59fd7ebb6 (issue4038) 2013-09-18 14:40:17 -04:00
statichttprepo.py statichttp: respect localrepo _restrictcapabilities 2014-04-07 11:45:50 -07:00
store.py store: drop unused existing list 2014-04-03 12:59:12 -05:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: normalize path in the specific way for problematic encodings 2014-05-08 19:03:00 +09:00
tags.py repoview: do not crash when localtags refers to non existing revisions 2014-06-29 13:52:35 +02:00
templatefilters.py templatefilter: add splitlines function 2014-06-12 17:45:41 -07:00
templatekw.py templatekw: move from dict() construction to {} literals 2014-03-12 13:20:42 -04:00
templater.py templater: introduce word function 2014-06-12 18:02:23 -07:00
transaction.py transaction: fix file descriptor leak for journal.backupfiles 2014-04-30 15:36:38 -07:00
treediscovery.py discovery: stop using nodemap for membership testing 2013-11-15 23:28:43 -05:00
ui.py cmdserver: forcibly use L channel to read password input (issue3161) 2014-04-26 18:13:06 +09:00
unionrepo.py config: set a 'source' in most cases where config don't come from file but code 2014-03-19 02:45:14 +01:00
url.py proxy: remove unneeded _set_hostport for compatibility with Python 2.7.7rc1 2014-05-22 22:05:26 +09:00
util.h util.h: declare dirstateTupleType variable instead of defining it 2014-07-03 19:05:04 +02:00
util.py util: replace 'ellipsis' implementation by 'encoding.trim' 2014-07-06 02:56:41 +09:00
verify.py verify: do not prevent verify repository containing hidden changesets 2014-02-19 22:19:45 +09:00
win32.py win32: backout 6891e5c66508 2014-05-03 10:33:54 +02:00
windows.py util: remove unused realpath (issue4063) 2013-12-29 13:54:04 +00:00
wireproto.py wireproto: expose the list of getbundle arguments to extensions 2014-05-22 01:49:12 -07:00
worker.py cleanup: move stdlib imports to their own import statement 2013-11-06 16:48:06 -05:00