Commit Graph

14791 Commits

Author SHA1 Message Date
Matt Mackall
9fe3bba5d0 Added signature for changeset 9377ee819950 2011-08-26 16:07:16 -05:00
Mads Kiilerich
a9383c13c5 subrepo: fix cloning of repos from urls without slash after host (issue2970)
This fixes a regression introduced with the new url handling in 1.9.

This should perhaps be fixed in the url class instead, but that might be too
invasive for a stable bugfix.
2011-08-26 16:23:35 +02:00
Idan Kamara
9b89917a5f ui: pass ' ' to raw_input when prompting
This is a workaround for calling ui.prompt(...), typing some character then
hitting backspace which causes the entire line to delete rather than just the
one character. This was seen on Debian using gnome-terminal.

(credits to Mads for the idea)

Python bug can be found here: http://bugs.python.org/issue12833
2011-08-25 22:06:03 +03:00
Peter Arrenbrecht
bc696e8298 dagutil: fix off-by-one in inverserevlogdag buildup 2011-08-25 17:20:00 +02:00
Wagner Bruna
c4594d5364 i18n-pt_BR: synchronized with 10dd4308888f 2011-08-19 10:05:23 -03:00
Wagner Bruna
6790ac4b35 help/config: strip trailing whitespace
This disabled paragraph splitting for translations.
2011-08-18 10:15:14 -03:00
Martin Geisler
efdbb8077d commands: clarify that 'hg heads foo' shows heads on branch foo
This is a FAQ: people try 'hg heads -r foo' and only see the tip-most
branch heads on foo.
2011-08-18 13:56:58 +02:00
Pang Yan Han
92e6290eb7 commands: fix grammar in resolve help text 2011-08-17 16:41:14 +08:00
Shun-ichi GOTO
dad35e5a06 win32: msvcr71.dll should be used for python 2.4 and 2.5
Following is list of C-Runtime for versions of CPython on windows:
 - python 2.4.5 => MSVCR71.dll
 - python 2.5.4 => MSVCR71.dll
 - python 2.6.6 => MSVCR90.dll
 - python 2.7   => MSVCR90.dll
 - python 3.1.2 => MSVCR90.dll
2011-08-08 14:32:27 +09:00
Matt Mackall
cb69aaee4e parsers: avoid pointer aliasing
Newer versions of GCC have aggressive pointer alias optimizations that
might get fooled by our pointer manipulations. These issues shouldn't
be encountered in practice because distutils compiles extensions with
-fno-strict-alias but the code was not valid according to the standard.
2011-08-10 13:40:01 -05:00
Matt Mackall
89e1387cb7 graphlog: attempt to fix index overrun (issue2912)
This bug may be caused by file subgraphs have more than two parents
per node. I have no idea if this fix is correct as the graphlog code
is mysterious, but it seems to be fine on the available test case.
2011-08-10 13:25:35 -05:00
Mads Kiilerich
6c5f486f38 test-http: test http authentication
The extension hack is based on Henrik Stuart's hg-textauth.
2011-08-05 00:39:54 +02:00
Patrick Mezard
107949ab73 http: pass user to readauthforuri() (fix f7ae45a69fcd)
urllib2 never handles URIs with credentials, we have to extract them and store
them in the password manager before handing the stripped URI. Half of the
changes deducing the username from the URI in f7ae45a69fcd were incorrect.
Instead, we retrieve the username from the password manager before passing to
readauthforuri().

test-hgweb-auth.py was passing because the test itself was flawed: it was
passing URIs with credentials to find_password(), which never happens.
2011-08-05 21:05:41 +02:00
Patrick Mezard
9aadd2540f http: strip credentials from urllib2 manager URIs (issue2885)
urllib2 password manager does not strip credentials from URIs registered with
add_password() and compare them with stripped URIs in find_password(). Remove
credentials from URIs returned by util.url.authinfo(). It sometimes works when
no port was specified as the URI host is registered too.
2011-08-05 21:05:40 +02:00
Idan Kamara
073a89cf8a dispatch: don't rewrap aliases that have the same definition
Previously aliases that overrode existing commands would wrap the old alias
on every call to dispatch() (twice actually), which is an obvious re-entrancy
issue for things like the command server or TortoiseHG.
2011-08-04 19:41:23 +03:00
Mads Kiilerich
965df356e5 url: really handle urls of the form file:///c:/foo/bar/ correctly
8264e5172141 made sure that paths that seemed to start with a windows drive
letter would not get an extra leading slash.

localpath should thus not try to handle this case by removing a leading slash,
and this special handling is thus removed.

(The localpath handling of this case was wrong anyway, because paths that look
like they start with a windows drive letter can't have a leading slash.)

A quick verification of this is to run 'hg id file:///c:/foo/bar/'.
2011-08-04 02:51:29 +02:00
Matt Mackall
be4e9d2a45 Added signature for changeset f7ae45a69fcd 2011-08-01 18:09:20 -05:00
Patrick Mezard
8028e79c02 hgweb: do not ignore [auth] if url has a username (issue2822)
The [auth] section was ignored when handling URLs like:

  http://user@example.com/foo

Instead, we look in [auth] for an entry matching the URL and supplied user
name. Entries without username can match URL with a username. Prefix length
ties are resolved in favor of entries matching the username. With:

  foo.prefix = http://example.org
  foo.username = user
  foo.password = password
  bar.prefix = http://example.org/bar

and the input URL:

  http://user@example.org/bar

the 'bar' entry will be selected because of prefix length, therefore prompting
for a password. This behaviour ensure that entries selection is consistent when
looking for credentials or for certificates, and that certificates can be
picked even if their entries do no define usernames while the URL does.
Additionally, entries without a username matched against a username are
returned as if they did have requested username set to avoid prompting again
for a username if the password is not set.

v2: reparse the URL in readauthforuri() to handle HTTP and HTTPS similarly.
v3: allow unset usernames to match URL usernames to pick certificates. Resolve
prefix length ties in favor of entries with usernames.
2011-08-01 23:58:50 +02:00
Matt Mackall
9dd4882287 hgweb: raw file mimetype guessing configurable, off by default (BC) (issue2923)
Before: hgweb made it possible to download file content with a content type
detected from the file extension. It would serve .html files as text/html and
could thus cause XSS vulnerabilities if the web site had any kind of session
authorization and the repository content wasn't fully trusted.

Now: all files default to "application/binary", which all important
browsers will refuse to treat as text/html. See the table here:

https://code.google.com/p/browsersec/wiki/Part2#Survey_of_content_sniffing_behaviors
2011-07-31 01:46:52 +02:00
wujek
05cf460c3e hgweb: handle 'baseurl' configurations with leading slash (issue2934) 2011-08-01 09:48:10 +02:00
Idan Kamara
bc85c198e4 ui: call write() so the prompt string goes through subclassed implementation 2011-08-01 19:53:00 +03:00
Matt Mackall
3f8cacb28b merge with i18n 2011-08-01 10:54:10 -05:00
FUJIWARA Katsunori
0875677233 i18n-ja: synchronized with 10d4374ba943 2011-07-31 23:42:40 +09:00
Jens Bäckman
ff491d52de i18n-sv: synchronized with dbba5d9fe305 2011-07-30 09:42:07 +02:00
Vasily Titskiy
a8f0b7449a subrepo: handle adding svn subrepo with a svn:external file in it (issue2931) 2011-07-28 13:28:32 -04:00
Idan Kamara
a315a7adaf hook: be prepared for __stdout/err__ not having fileno()
it may have been replaced, see https://bitbucket.org/tortoisehg/thg/issue/937
2011-07-30 23:41:10 +03:00
Idan Kamara
19f1b36e00 dispatch: make sure global options on the command line take precedence
So if a user has verbose=True somewhere in his .hgrc files, giving -q
on the command line will override that.

This basically reverts cd10f447ccba.
2011-07-30 21:04:14 +03:00
Augie Fackler
8e5c4fa38c http2: send an extra header to signal a non-broken client
Some proxies strip the expect header because they forward requests in
a non-compliant way or as a way to defend against bogus clients.
2011-07-27 18:35:35 -05:00
Augie Fackler
a8600f4669 httpclient: import ca33b88d143c from py-nonblocking-http (issue2932) 2011-07-29 12:46:45 -05:00
Andrei Vermel
13bbba1de3 color.py - clear _terminfo_params in win32 mode 2011-07-29 15:36:27 +04:00
Benoit Boissinot
573390f2a4 url: store and assume the query part of an url is in escaped form (issue2921) 2011-07-31 21:00:44 +02:00
Andrew Pritchard
f23118834a setdiscovery: return anyincoming=False when remote's only head is nullid
This fixes (issue2907) a crash when using 'hg incoming --bundle' with an empty
remote repo and a non-empty local repo.

This also fixes an unreported bug that 'hg summary --remote' erroneously
reports incoming changes when the remote repo is empty and the local is not.

Also, add a test to make sure issue2907 stays fixed
2011-07-27 18:32:54 -04:00
FUJIWARA Katsunori
a423a1ab9d i18n: use UTF-8 string to lower filename for case collision check
Some character sets, cp932 (known as Shift-JIS for Japanese) for
example, use 0x41('A') - 0x5A('Z') and 0x61('a') - 0x7A('z') as second
or later character.

In such character set, case collision checking recognizes different
files as CASEFOLDED same file, if filenames are treated as byte
sequence.

win32mbcs extension is not appropriate to handle this problem, because
this problem can occur on other than Windows platform only if
problematic character set is used.

Callers of util.checkcase() use known ASCII filenames as last
component of path, and string.lower() is not applied to directory part
of path. So, util.checkcase() is kept intact, even though it applies
string.lower() to filenames.
2011-07-28 14:36:07 +09:00
Wagner Bruna
92a9350b35 test-i18n, i18n-pt_BR: updated test message changed in 73e761bdb384 2011-07-22 20:31:15 -03:00
Wagner Bruna
47fc87f884 i18n-pt_BR: synchronized with ea9f5211c508 2011-07-22 20:27:40 -03:00
Augie Fackler
88cecc18f1 rebase: remove trailing whitespace found by check-code 2011-07-21 15:56:15 -05:00
Lee Cantey
22431d693c hooks: use python 2.4 compatible exception handling 2011-07-22 08:03:47 -07:00
Matt Mackall
8fc00f653d url: handle urls of the form file:///c:/foo/bar/ correctly 2011-07-22 17:11:35 -05:00
David Golub
11baa243a9 dispatch: avoid double backslashes in error message
The use of %r in the format string caused Python to display Windows paths with
double backslashes.
2011-07-21 16:02:34 -04:00
Matt Mackall
edf401959a revert: restore check for uncommitted merge (issue2915) (BC)
This will restore the pre-1.9 behavior.
2011-07-21 15:39:37 -05:00
Kevin Bullock
e4deb92563 subrepo: don't commit in subrepo if it's clean
If a subrepo has changed relative to the outer repo's substate, but the
subrepo itself is clean, we don't need to commit in the subrepo.
2011-07-19 13:43:53 -05:00
Stefano Tortarolo
1f811e0952 rebase: block collapse with keepbranches on multiple named branches (issue2112)
Collapse and keepbranches should be blocked when there is more than
one named branch on the branch that's going to be rebased.
2011-07-18 22:58:21 +02:00
Idan Kamara
361e7cfb4a win32: assign winstdout to sys.__stdout__ as well (issue2888)
On Windows sys.stdout was being replaced with winstdout, which caused
util.system() to redirect its output (due to 388eabdda556). That causes
interactive tools (such as vim) to stop working.
2011-07-16 15:24:28 +03:00
Idan Kamara
76465b4a18 hooks: redirect stdout/err/in to the ui descriptors when calling python hooks
We need to make sure that python hooks I/O goes through the ui descriptors so
it doesn't mess the command server protocol.
2011-07-09 19:06:59 +03:00
Stefano Tortarolo
80ea985fc0 rebase: reset bookmarks (issue2265 and issue2873) 2011-07-15 20:07:19 +02:00
Idan Kamara
bab89cfab6 cmdserver: take repo.baseui as our ui
The ui passed to server() is really repo.ui, that is it contains its local
configuration as well.

When running commands that use a different repo than the servers cached repo,
we don't want to use that ui as the baseui for the new repo.
2011-07-14 11:46:15 +03:00
Benoit Allard
511619b7ee web: Output a correct date in short format (issue2902) 2011-07-15 10:18:24 +02:00
Idan Kamara
d17c3e4003 test-commandserver: explicitly close opened file 2011-07-15 16:28:09 +03:00
Matt Mackall
4a061c0990 merge with i18n 2011-07-13 19:30:09 -05:00
Matt Mackall
c78a7611d4 subrepo: use working copy of .hgsub to filter status (issue2901) 2011-07-13 17:41:49 -05:00