Commit Graph

15737 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
529dcf14a4 windows: force specified path to be audited in localpath form
pathauditor is invoked not only for localpath form using "os.sep" as
separator, but also for normalized form using "/": for example, hg
internal path like "store/data" under ".hg", or ones normalized by
match object

this causes insufficient repository nesting check, because current
pathauditor implementation divides specified path into components by
"os.sep", and this causes to treat multiple path components joined by
"/" as single one on Windows environment.

this patch applies "util.localpath()" on specified path to force it to
be divided into components correctly.

in fact, root for pathauditor also uses multiple path separator on
Windows. but this does not affect audit itself, so "util.localpath()"
is not applied on it.
2011-12-24 19:01:07 +09:00
Laurens Holst
8daae4999d context: add isbinary function 2011-12-21 18:20:15 +01:00
Pierre-Yves David
84e54fd93c rebase: add a "D" short option for detach
Detach is usually what I want when I use --source or (in particular) --rev.
Having a shorter option make it less an hassle to use it.
2011-12-27 21:12:09 +01:00
Pierre-Yves David
30c8f3e74a rebase: allow --detach when --rev is used
--rev is only a more specific --source and there is no reason to refuse to use
detach with it.
2011-12-27 20:45:46 +01:00
Matt Mackall
dc09090fed merge with stable 2011-12-26 18:08:20 -06:00
Matt Mackall
282d4f5a2e merge with i18n 2011-12-26 18:07:49 -06:00
Alexander Sauta
710f7422e2 i18n-ru: translated notify, pager 2011-12-25 19:49:14 +03:00
FUJIWARA Katsunori
8a4c96d3b4 icasefs: add test for case preservation on case insensitive filesystem
"hg qpush" causes unexpected behavior, if case preservation on case
insensitive filesystem is not enough.

this patch adds the test using mixed-case filenames to reproduce this
problem on any case insensitive filesystems.
2011-12-24 19:16:36 +09:00
FUJIWARA Katsunori
20f2cd3a0c i18n: use "encoding.lower()" to normalize string in hgweb search query
some problematic encoding (e.g.: cp932) uses ASCII alphabet characters
in byte sequence of multi byte characters.

"str.lower()" on such byte sequence may treat distinct characters as
same one, and cause unexpected log matching.

this patch uses "encoding.lower()" instead of "str.lower()" to
normalize strings for compare.
2011-12-25 20:35:16 +09:00
FUJIWARA Katsunori
09db6940ae i18n: use "encoding.lower()" to normalize specified string for revset
some problematic encoding (e.g.: cp932) uses ASCII alphabet characters
in byte sequence of multi byte characters.

"str.lower()" on such byte sequence may treat distinct characters as
same one, and cause unexpected log matching.

this patch uses "encoding.lower()" instead of "str.lower()" to
normalize strings for compare.
2011-12-25 20:35:16 +09:00
FUJIWARA Katsunori
9dd2a411a7 i18n: use "encoding.lower()" to normalize specified keywords for log searching
some problematic encoding (e.g.: cp932) uses ASCII alphabet characters
in byte sequence of multi byte characters.

"str.lower()" on such byte sequence may treat distinct characters as
same one, and cause unexpected log matching.

this patch uses "encoding.lower()" instead of "str.lower()" to
normalize strings for compare.
2011-12-25 20:35:16 +09:00
FUJIWARA Katsunori
a8d00559c9 win32mbcs: allow win32mbcs extension to be enabled on cygwin platform
this patch allows win32mbcs extension to be enabled on cygwin platform
for problematic character encodings.

on recent cygwin platform, even though
"os.path.supports_unicode_filenames" is False, "os.listdir()" and
other path manipulation functions can return the result correctly
decoded in unicode for invocations with unicode arguments, if locale
is configured properly.

existing code to check "os.path.supports_unicode_filenames" is kept to
prevent win32mbcs from being enabled on unexpected platform.
2011-12-25 20:32:48 +09:00
FUJIWARA Katsunori
3abfeb7e54 icasefs: rewrite comment to explain situtation precisely 2011-12-24 00:52:06 +09:00
FUJIWARA Katsunori
b180efb872 icasefs: follow standard cache look up pattern 2011-12-24 00:51:14 +09:00
FUJIWARA Katsunori
1edd7d1c6d icasefs: disuse length check against un-normcase()-ed filenames
this patch disuses length check against un-normcase()-ed filenames
gotten by "os.listdir()", because there is no assurance that
filesystem stores filenames normalized except in letter case, even
though some case insensitive filesystems (in some environment, for
some language setting) store them in such manner.
2011-12-24 00:50:56 +09:00
Matt Mackall
11aa73a675 merge with stable 2011-12-22 15:56:27 -06:00
Matt Mackall
d818ed051b merge with i18n 2011-12-22 15:56:17 -06:00
Pierre-Yves David
8abd0aa7c9 phases: do not exchange secret changesets
Any secret changesets will be excluded from pull and push. Phase data are
properly synchronized on pull and push if a changeset is seen as secret locally
but is non-secret remote side.

This patch does not handle the case of a changeset secret on remote but known
locally.
2011-12-22 00:42:25 +01:00
Pierre-Yves David
ef5fe34436 phases: test the new-commit option and proper inheritence of phase 2011-12-22 00:40:46 +01:00
Fabian Kreutz
574046fada i18n-de: Translations and fixes until line 6000; more annotations 2011-12-21 11:48:18 +02:00
Kevin Bullock
0fb78c49bd graft: use consistent language in help
Removes the word 'aborted' from the 3rd paragraph in favor of
'interrupted', the same word used in the description of the
-c/--continue switch. The word 'interrupted' is also consistent with
the help for rebase.
2011-12-20 14:11:14 -06:00
Matt Mackall
c0c746bcbd largefiles: copy files in binary mode (issue3164) 2011-12-20 11:43:38 -06:00
Alexander Sauta
31525035a1 i18n-ru: translated inotify, interhg; skipped strings added 2011-12-19 22:40:59 +03:00
Fabian Kreutz
76842b8379 i18n-de: New translations, mostly largefiles extension 2011-12-19 14:11:37 +02:00
Pierre-Yves David
1fd5692284 phases: add a function to compute visible heads
This function will be used to hide secret changeset.
2011-12-19 11:37:44 +01:00
Pierre-Yves David
3d9a6a91e3 phases: Add a third phase for secret changeset 2011-12-18 23:16:46 +01:00
Pierre-Yves David
d7a17ef9c1 phases: fix advanceboundary behavior when targetphase !=0
Changeset was properly removed from upper phase but was not explicitly added to
target phase. If advanced changesets had not pwasnt in target phase they was
considered public (0-phase).
2011-12-19 11:29:39 +01:00
Pierre-Yves David
6284fc8c91 phases: add a bit more test for local phase movement. 2011-12-18 23:15:12 +01:00
Matt Mackall
4ee9450bf7 merge with stable 2011-12-19 14:04:33 -06:00
Matt Mackall
952107b8ae merge with i18n 2011-12-19 14:04:26 -06:00
Matt Mackall
e996adc45c merge with i18n 2011-12-19 14:04:09 -06:00
Martin Schröder
67b13dcfb8 i18n-de: several new translations 2011-12-19 13:02:30 +01:00
Alexander Sauta
4517fd3525 i18n-ru: translated convert messages 2011-12-18 22:54:43 +03:00
Alexander Sauta
79e1112dbe i18n-ru: translated bugzilla 2011-12-18 01:05:52 +03:00
Alexander Sauta
40c876833c i18n-ru: synchronized with e0328f8bb912 2011-12-17 20:21:52 +03:00
Matt Mackall
7cf4e6eacb merge with stable 2011-12-16 19:05:59 -06:00
Wagner Bruna
9ee7384a84 merge with i18n stable 2011-12-16 10:47:17 -02:00
Wagner Bruna
a06c171c9c merge with i18n 2011-12-16 10:44:08 -02:00
Wagner Bruna
ccd491a91c i18n-pt_BR: synchronized with de6501d18b23 2011-12-16 10:43:18 -02:00
FUJIWARA Katsunori
1a00d3603f merge: check filename case collision between changesets for branch merging
this patch makes branch merging abort when merged changesets have same
file in different case on case insensitive filesystem.

this patch does not prevent linear update which merges between target
and working contexts, because 'branchmerge' is False in such case.
2011-12-16 21:21:27 +09:00
FUJIWARA Katsunori
d86fd5584a cygwin: add cygwin specific normcase logic
in cygwin environment, mount point part of path is treated as case
sensitive, even though underlying NTFS is case insensitive.

this patch preserves mount point part of specified path, only if it is
absolute one.

there is no easy way to get list of current mount points from python
program, other than to execute "mount" external command, because
cygwin does not store current mount points into Unix/Linux like
/etc/XXXtab file.

so, this patch introduces cygwinmountpoints variable to list mount
points to be preserved case.

this allows some other extensions to customize mount point
configuration.
2011-12-16 21:21:08 +09:00
FUJIWARA Katsunori
fe972435d4 i18n: use encoding.lower/upper for encoding aware case folding
this patch uses encoding.lower/upper for case folding, because ones of
str can not fold case of non ascii characters correctly.

to avoid cyclic dependency and to encapsulate logic of normcase in
each platforms, this patch introduces encodinglower/encodingupper in
both posix/windows specific files.

this patch does not change implementation of normcase() in posix.py,
because we do not know the encoding of filenames on POSIX.

some "normcase()" are excluded from function wrap list in
hgext/win32mbcs.py, because they become encoding aware by this patch.
2011-12-16 21:09:41 +09:00
FUJIWARA Katsunori
2d248cd109 icasefs: avoid path-absoluteness/existance check in util.fspath() for efficiency
'dirstate._normalize()', the only caller of 'util.fspath()', has
already confirmed exsistance of specified file as relative to root.

so, this patch omits path-absoluteness/existance check from
'util.fspath()'.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
cfdf6a59f4 windows: use upper() instead of lower() or os.path.normcase()
this patch uses upper() instead of lower() or os.path.normcase() for
case folding on Windows(NTFS), because lower-ing causes problems for
some languages on it.

see below for detail about problem of lower-ing:

    https://blogs.msdn.com/b/michkap/archive/2005/01/16/353873.aspx
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
b5973249bd icasefs: retry directory scan once for already invalidated cache
some hg operation (e.g.: qpush) create new files after first
dirstate.walk()-ing, and it invalidates _fspathcache for fspath().

then, fspath() will fail to look up specified name in _fspathcache.

this causes case preservation breaking, because parts of already
normcase()-ed path are used as result at that time.

in this case, file creation and writing out should be done before
fspath() invocation, so the second invocation of os.listdir() has not
so much impact on runtime performance.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
055136813d icasefs: avoid normcase()-ing in util.fspath() for efficiency
'dirstate._normalize()', the only caller of 'util.fspath()', has
already normcase()-ed path before invocation of it.

normcase()-ed root can be cached on dirstate side, too.

so, this patch changes 'util.fspath()' API specification to avoid
normcase()-ing in it.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
c71595845e icasefs: use util.normcase() instead of lower() or os.path.normcase in fspath
this also avoids lower()-ing on each path components by reuse the path
normcase()-ed at beginning of function.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
167dff84e5 dirstate: prevent useless util.fspath() invocation for '.'
at first of dirstate.walk() on case insensitive filesystem,
normalization of '.' causes util.fspath() invocation, but '.' is not
cached in it.

this invocation is not only useless, but also harmful: initial "hg
tag" causes creation of ".hgtags" file after dirstate.walk(), and
looking up ".hgtags" in cache will fail, because directory contents of
root is already cached at util.fspath() invocation for '.'.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
f9ca02bd18 icasefs: consider as case sensitive if there is no counterevidence, for safety
for safety, this patch prevents case-less name from misleading into
case insensitivity, even though such names should not be used.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
44af3b0ebf pathauditor: switch normcase logic according to case sensitivity of filesystem
this patch applies 'util.normcase()' to audit path only on case
insensitive filesystem.
2011-12-16 21:09:40 +09:00