Commit Graph

7776 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Matt Mackall
c78a7611d4 subrepo: use working copy of .hgsub to filter status (issue2901) 2011-07-13 17:41:49 -05:00
Matt Mackall
1f03009146 verify: filter messages about missing null manifests (issue2900) 2011-07-13 16:28:46 -05:00
Idan Kamara
550bca7579 cmdserver: restore old working dir after dispatch when we have --cwd 2011-07-11 17:49:45 +03:00
Idan Kamara
27bbf9363c dispatch: don't use request repo if we have --cwd 2011-07-11 17:46:55 +03:00
Steve Borho
bb2fdf8f33 scmutil: add missing import of re
see https://bitbucket.org/tortoisehg/thg/issue/929
2011-07-08 20:24:19 -05:00
Matt Mackall
47766aa6d3 revsets: actually catch type error on tip^p1(tip) (issue2884)
The previous commit was empty.
2011-07-12 12:35:03 -05:00
Martin Geisler
d1589aefcc commands: improve help for -y/--noninteractive
Before, the help text said that Mercurial would assume 'yes' for all
prompts, but this is confusing since many prompts don't have any 'yes'
choice. It now more accurately describes what will happen.
2011-07-07 10:32:30 +02:00
Matt Mackall
73b047e45e revsets: do the right thing with x^:y (issue2884)
Given an operator ^ that's either postfix or infix and an operator :
that's either prefix or infix, the parser can't figure out the right
thing to do. So we rewrite the expression to be sensible in the optimizer.
2011-07-06 13:37:50 -05:00
Matt Mackall
b06b887ee8 discovery: quiet note about heads
This was changing output on in/out -v for no good reason.
2011-07-05 14:30:42 -05:00
Wagner Bruna
56657ac28b patch: fix parsing patch files containing CRs not followed by LFs
Since 75e6e3c16f9c , patch lines containing a CR not followed by a LF
would be incorrectly splitten, causing a failure to apply the patch.
2011-07-04 19:53:39 -03:00
Idan Kamara
9401c4603c fileset: fix typo in binary() doc 2011-07-04 14:36:16 +03:00
Arne Babenhauserheide
81729d0d3f help: fileset foo.lst was named files.lst 2011-07-01 22:50:36 +02:00
Mads Kiilerich
e8138203dd util: rename the util.localpath that uses url to urllocalpath (issue2875)
util is never imported by any other name than util, so this is mostly just a
simple search and replace from util.localpath to util.urllocalpath (assuming
other uses of util.localpath already has been renamed).
2011-07-01 17:37:09 +02:00
Eli Carter
8827c54a9a subrepo: correct revision in svn checkout
A Subversion subrepo checkout uses a url and --revision which does not do the
correct thing when specifying a revision of a branch that has since been
deleted and recreated.  The checkout needs to specify the revision as URL@REV
instead.
2011-06-30 13:22:12 -05:00
Matt Mackall
b80e3885ef merge with i18n 2011-06-29 16:05:41 -05:00
Jesse Long
33d5742949 hgweb: treat branch attribute closed' as more important than inactive'
In the branches page, branches that are closed and are merged into another
branch are displayed as `inactive'. This patch changes that behaviour to
show these branches as `closed'.

For me, the `closed' attribute is more important than the `inactive'
attribute.

Branches that are not closed, and are merged into other branches will still
be shown as `inactive'.

Branches that are closed, and are not merged into other branches will still
be shown as `closed'.
2011-06-29 09:36:45 +02:00
Matt Mackall
8e3367eb55 subrepos: be smarter about what's an absolute path (issue2808) 2011-06-29 16:01:06 -05:00