Commit Graph

15365 Commits

Author SHA1 Message Date
Matt Mackall
720ed4fcd7 alias: shortcut command matching show shadowing works properly (issue3104)
An alias for 'log' was stored in the same command table as
'^log|history'. If the hash function happens to give the latter first,
the alias is effectively ignored when matching 'log'.
2011-12-01 15:51:36 -06:00
Patrick Mezard
1d6a6d6bd8 convert/svn: fix URL quoting issue with svn 1.7
As of svn 1.7, many svn calls expect "canonical" paths. In theory, we should
call svn.core.*canonicalize() on all paths before passing them to the API.
Instead, we assume the base url is canonical and copy the behaviour of svn URL
encoding function so we can extend it safely with new components.
2011-12-01 20:42:24 +01:00
Na'Tosha Bard
60040a8402 largefiles: fix rename (issue3093) 2011-11-30 15:11:00 +01:00
Sune Foldager
b1f5c2e814 bundlerepo: don't write branch cache to disk
Calling branchmap() or similar on a bundlerepo would write the bundle-augmented
branch cache to disk, requiring a subsequent expensive rebuild when the repo
is used without the bundle.
2011-12-01 14:17:17 +01:00
Matt Mackall
a837de171f revset: balance %l or-expressions (issue3129) 2011-11-30 22:43:24 -06:00
Matt Mackall
6e77a4d58a merge with i18n 2011-11-30 17:16:43 -06:00
Benoit Allard
f3be9c5304 diff: '\ No newline at end of file' is also not part of the header
Diff containing '\ No newline at end of file' were colorized incorrectly.
2011-11-29 19:51:35 +01:00
Wagner Bruna
a3ad9631f9 i18n-pt_BR: synchronized with 598dd12000c9 2011-11-29 12:40:26 -02:00
Mads Kiilerich
2af29b7753 largefiles: avoid use of uinitialized variable in case of errors 2011-11-25 02:09:48 +01:00
Mads Kiilerich
a9264240dc tests: remove unstable debugstate output in test-largefiles.t 2011-11-25 02:09:45 +01:00
Martin Geisler
161f84c84c largefiles: copy files into .hg/largefiles atomically
Copying from the user cache into .hg/largefiles could fail halfway
though with a partially written file.
2011-11-24 18:13:18 +01:00
Martin Geisler
de1d410b06 largefiles: write .hg/largefiles/ files atomically
Before, it was possible to create a

  .hg/largefiles/hash

file with truncated content, i.e., content where

  SHA-1(content) != hash

This breaks the fundamental invariant in largefiles that the file
content for files in .hg/largefiles hash to the filename.
2011-11-24 18:12:13 +01:00
Martin Geisler
ebb23d0eaa largefiles: add comment about non-atomic working directory
When updating the working copy with a normal 'hg update', we also
don't use atomic writes.
2011-11-24 18:11:43 +01:00
FUJIWARA Katsunori
d9039e2664 largefiles: use "ui.configlist()" to get largefiles.patterns configuration
current lfconvert implementation uses combination of "ui.config()" and
"str.split(' ')" to get largefiles.patterns configuration.

but it can not handle multiline configuration in hgrc files correctly.

lfconvert should use "ui.configlist()" instead of it, as same as
override_add does.
2011-11-24 17:54:50 +09:00
Matt Mackall
8fc7c196b4 convert: handle trailing slashes in filemap better (issue3124) 2011-11-23 16:25:44 -06:00
Matt Mackall
7f4a5bf4c9 tests: remove test-casecollision-i18n.t
The result of this test is quite suspect. Remove it for now as it now
correctly breaks on HFS+.
2011-11-23 14:24:56 -08:00
Matt Mackall
4ed869c059 posix: fix HFS+ percent-encoding folding
We use 'ignore' rather than 'replace' so we don't have to deal with
u+FFFD in UTF-8 round-trip.
2011-11-23 14:22:37 -08:00
Mads Kiilerich
629eb6e680 tests: test-largefiles.t should not try to escape from $TESTTMP 2011-11-22 19:56:26 +01:00
Mads Kiilerich
eb44c968ee largefiles: file storage should be relative to repo, not relative to cwd
Revealed by the test in 43cf449a75e4.
2011-11-22 19:52:23 +01:00
Augie Fackler
ca0638e3d0 clone: don't save user's password in .hg/hgrc (Issue3122) 2011-11-22 12:06:42 -06:00
Matt Mackall
de7392db69 posix: add extended support for OS X path folding
OS X does the following transformation on paths for comparisons:

a) 8-bit strings are decoded as UTF-8 to UTF-16
b) undecodable bytes are percent-escaped
c) accented characters are converted to NFD decomposed form, approximately
d) characters are converted to _lowercase_ using internal tables

Both (c) and (d) are done using internal tables that vary from release
to release and match Unicode specs to greater or lesser extent. We
approximate these functions using Python's internal Unicode data.

With this change, Mercurial will (in almost all cases) match OS X
folding and not report unknown file aliases for files in UTF-8 or
other encodings.
2011-11-22 17:26:32 -06:00
Matt Mackall
14399ab3d4 dirstate: use util.normcase to build foldmap 2011-11-22 17:26:31 -06:00
Martin Geisler
28455d6a6b largefiles: fix 'hg clone . ../foo' OSError abort
Operating on a non-existant file can cause both IOError and OSError,
depending on the function used: open raises IOError, os.lstat raises
OSError.

The largefiles code called dirstate.normal, which in turn calls
os.lstat, so OSError is the right exception to catch here.
2011-11-22 17:51:43 +01:00
Mads Kiilerich
ba2b5b0d23 update: don't clobber untracked files with wrong casing 2011-11-20 23:09:32 +01:00
Matt Mackall
d795921141 merge with i18n 2011-11-20 16:06:51 -06:00
Wagner Bruna
53444db76c i18n-pt_BR: synchronized with 16bb54565f4f 2011-11-18 10:21:56 -02:00
Mads Kiilerich
7f38d9b9d4 help: Backed out changeset daf758dccb52, description of file urls
This help entry didn't try to describe the 'localhost' notation. It described a
non-standard host-less notation where 'local' just was the first part of a
sample relative path. It describe "urls" with relative and absolute paths like:

  file://file.txt
  file:///tmp/file.txt
  file://c:/tmp/file.txt
2011-11-18 01:32:28 +01:00
Matt Mackall
8de0c77dee revset: follow(nosuchfile) should give an empty set (issue3114) 2011-11-20 15:29:55 -06:00
Thomas De Schampheleire
09f4a92184 hook: flush stdout before redirecting to stderr
When hook output redirection is enabled (e.g. when cloning over ssh), hook
output on stdout is redirected to stderr, to prevent the repository data on
stdout from being corrupted.
In certain cases, the redirection could cause part of the repository data to
end up on stderr as well. In case of a clone, this causes:
"abort: consistency error in delta!"

This was seen with a clone over ssh, an outgoing hook present (any
non-python type, e.g. 'pwd'), on certain repositories only,
probably depending on the distribution of the sent data)

This patch updates the hook redirection code to flush stdout before
redirecting, removing the problem.
2011-11-16 08:34:36 +01:00
Patrick Mezard
942cefafa6 import: fix parent selection when importing merges
With "wp1" and "wp2" the current working directory parents, "p1" and "p2" the
patch parents and "parents" the resulting commit parents, the current behaviour
is:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  [wp1, wp2]/buggy
0        1       0  [p1]
0        1       1  [p1, p2]
1        0       0  [wp1, wp2]
1        0       1  [p1, p2]
1        1       0  [p1]
1        1       1  [p1, p2]

The original behaviour before 1f543fd375c5 was:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  if p1 == wp1 then [p1, p2] otherwise [wp1, wp2]
0        1       0  [p1]
0        1       1  [p1, p2]

This patch restores the previous behaviour when --bypass is not set, and align
--bypass behaviour when --exact is not set with merge diffs.
2011-11-16 12:53:10 +01:00
Patrick Mezard
16811ddcba diff: --ignore-blank-lines was too enthusiastic
It was ignoring changes from:

ab

to:

a
b
2011-11-13 21:37:14 +01:00
Stefano Tortarolo
f195f71994 graft: disallow grafting grafted csets in specific situations (issue3091)
In particular, we do not allow:
- grafting an already grafted cset onto its original branch
- grafting already grafted csets with the same origin onto each other
2011-11-12 14:00:25 +01:00
Stefano Tortarolo
2dbc061389 graft: use revs to make tests more readable 2011-11-12 11:23:52 +01:00
Stefano Tortarolo
dfee711e26 graft: preserve original source in subsequent grafts 2011-11-12 13:15:40 +01:00
Dmitry Panov
6649925e57 makedate: wrong timezone offset if DST rules changed this year (issue2511)
Python's time module sets timezone and altzone based on UTC offsets of
two dates: first and middle day of the current year. This approach
doesn't work on a year when DST rules change.

For example Russia abandoned winter time this year, so the correct UTC
offset should be +4 now, but time.timezone returns 3 hours difference
because that's what it was on 01.01.2011.

Related python issue: http://bugs.python.org/issue1647654
2011-11-13 00:29:26 +00:00
Marc-Antoine Ruel
05df0333e0 posix: fix findexe() to check for file type and access 2011-11-16 17:55:32 -06:00
Mads Kiilerich
b49a4ee31a subrepo: use correct paths for subrepos with ..-relative paths on windows
posixpath normpath of c:\foo\bar/../baz is baz, so now we pconvert first.
2011-11-15 02:16:30 +01:00
Mads Kiilerich
065de91b14 add missing localization markup 2011-11-11 01:07:10 +01:00
Mads Kiilerich
5d7000644a url: handle file://localhost/c:/foo "correctly"
The path was parsed correctly, but localpath prepended an extra '/' (as in
'/c:/foo') because it assumed it was an absolute unix path.
2011-11-16 00:10:56 +01:00
Mads Kiilerich
85ec0fb7bf help: it is 'file://localhost/', not 'file://local/'
The documentation has apparently always been wrong.
2011-11-16 00:10:52 +01:00
Matt Mackall
3eab62750e dirstate: fix case-folding identity for traditional Unix
We used to use os.path.normcase which was a no-op, which was unhelpful
for cases like VFAT on Linux.
2011-11-15 14:25:11 -06:00
Thomas Arendsen Hein
5f8b5fa5ff convert/bzr: fix test of divergent nested renames for bzr 1.x
7ad43b163555 introduced a new block in test-convert-bzr-directories.t
which produces a slightly different output with older bzr versions.
Tested with bzr 1.5 on Debian lenny.
2011-11-15 17:16:17 +01:00
Eric Roshan Eisner
5dcac2b222 subrepo: fix git status false positive (issue3109)
It turns out there's a separate command to force git to look at file contents
if the stat has changed.
2011-11-11 11:11:11 +11:11
Matt Mackall
71fadf8296 tests: fix trailing whitespace 2011-11-10 17:06:12 -06:00
Matt Mackall
79f43ffdfe hgweb: add hint about finding library path with debuginstall 2011-11-10 15:08:51 -06:00
FUJIWARA Katsunori
970e57770c largefiles: treat status of cache missed largefiles as "missing" correctly
"hg status" may treat cache missed largefiles as "removed" incorrectly.

assumptions for problem case:

  - there is no cache for largefile "L"
  - at first, update working directory to the revision in which "L" is
    not yet added,
  - then, update working directory to the revision in which "L" is
    already added

and now, "hg status" treats "L" as "removed".

current implementation does not allocate entry for cache missed
largefile in ".hg/largefiles/dirstate", but files without
".hg/largefiles/dirstate" entry are treated as "removed" by largefiles
extension.

"hg revert" can not recover from this situation, but "rm -rf
.hg/largefiles", because it causes dirstate rebuilding.

this patch invokes normallookup() for cache missed largefiles to
allocate entry in ".hg/largefiles/dirstate", so "hg status" can treat
it as "missing" correctly.
2011-11-11 02:33:01 +09:00
Matt Mackall
08d628312f merge with i18n 2011-11-10 11:00:02 -06:00
Martin Geisler
fb433db1d3 i18n-da: add new strings from Mercurial 2.0 2011-11-09 18:58:17 +01:00
Martin Geisler
32c5911455 i18n-ru: fix translation of --logfile (issue3095) 2011-11-09 18:26:54 +01:00
Stefano Tortarolo
b157d6deb9 rebase: ensure target is not taken as external (issue3085)
This could happen in specific situations in which 'target'
was selected as external and used for p1 _and_ p2.
2011-11-08 17:09:48 +01:00