Commit Graph

6925 Commits

Author SHA1 Message Date
Adrian Buehlmann
b1824b07a4 opener: check hardlink count reporting (issue1866)
The Linux CIFS kernel driver (even in 2.6.36) suffers from a hardlink
count blindness bug (lstat() returning 1 in st_nlink when it is expected
to return >1), which causes repository corruption if Mercurial running
on Linux pushes or commits to a hardlinked repository stored on a Windows
share, if that share is mounted using the CIFS driver.

This patch works around issue1866 and improves the workaround done in
65e082ae3076 to fix issue761, by teaching the opener to lazily execute a
runtime check (new function checknlink) to see if the hardlink count
reported by nlinks() can be trusted.

Since nlinks() is also known to return varying count values (1 or >1)
depending on whether the file is open or not and depending on what client
and server software combination is being used for accessing and serving
the Windows share, we deliberately open the file before calling nlinks() in
order to have a stable precondition. Trying to depend on the precondition
"file closed" would be fragile, as the file could have been opened very
easily somewhere else in the program.
2010-11-07 18:21:29 +01:00
Nicolas Dumazet
f48c256c16 revlog: fix descendants() if nullrev is in revs
We were not returning the correct result if nullrev was in revs, as we
are checking parent(currentrev) != nullrev before yielding currentrev

test-convert-hg-startrev was wrong: if we start converting from rev -1 and
onwards, all the descendants of -1 (full repo) should be converted.
2010-11-07 18:23:48 +09:00
Nicolas Dumazet
31a27ed9b9 revlog: if start is nullrev, end is always a descendant 2010-11-07 18:16:07 +09:00
Steve Losh
3171599307 alias: fall back to normal error handling for ambigious commands (fixes issue2475) 2010-11-05 15:54:32 -04:00
Ronny Pfannschmidt
7701046742 subrepo: test & fix svn subrepo removal 2010-11-05 15:13:22 +01:00
Adrian Buehlmann
57283f18cb util: refactor opener
- Don't call atomictempfile or nlinks() if the path is malformed
  (no basename). Let posixfile() raise IOError directly.
- atomictempfile already breaks up hardlinks, no need to poke
  at the file with nlinks() if atomictemp.
- No need to copy the file contents to break hardlinks for 'w'rite
  modes (w, wb, w+, w+b). Unlinking and recreating the file is faster.
2010-11-04 09:04:37 +01:00
Matt Mackall
341df0d469 dirstate: skip optimization on case-folding FS (issue2440) 2010-11-01 14:18:42 -05:00
Mads Kiilerich
0f04e7650d url: fix https client authentication through proxy
There is no tests for this, but the parameter order was obviously wrong.
2010-11-01 01:56:12 +01:00
Matt Mackall
bc13e3d384 commit: handle missing newline on last commit comment 2010-10-30 12:13:52 -05:00
Patrick Mezard
00e188f176 localrepo: do not modify ctx.remove() list in-place 2010-11-01 17:26:08 +01:00
Matt Mackall
627b247624 demandimport: back out ccffe6051751 (issue2467) 2010-10-30 11:32:04 -05:00
Matt Mackall
dbab506672 debugindex: add --format flag to allow debugging parentdelta
-f 1 shows extra data from revlogv1 (aka revlogng) including flags and size

(based on a patch by Pradeepkumar Gayam <in3xes@gmail.com>)
2010-10-30 02:47:35 -05:00
Matt Mackall
90141f6021 revlog: choose best delta for parentdelta (issue2466)
When parentdelta is enabled, we choose the delta that has the minimum
distance to its base. Otherwise, base may be sufficiently far away to
require a full version, resulting in greatly reduced compression.
2010-10-30 02:47:34 -05:00
Matt Mackall
d0eecfc8e5 revlog: precalculate p1 and p2 revisions 2010-10-30 02:47:34 -05:00
Matt Mackall
9e1ed89cc3 revlog: extract delta building to a subfunction 2010-10-30 02:47:34 -05:00
Matt Mackall
4d0c140fd2 revlog: simplify cachedelta handling 2010-10-30 02:47:34 -05:00
Matt Mackall
a758f18a0a revlog: fix buildtext local scope
buildtext stores its result in _addrevision scope to avoid repeated builds
cachedelta is already visible
2010-10-30 02:47:34 -05:00
Martin Geisler
23c9a547e5 opener: do not create "foo" directory when writing to "foo/"
The directories were not cleaned up when the subsequent open failed
and this would confuse things like qnew.
2010-10-29 12:50:08 +02:00
Patrick Mezard
a3c9b27eda patch: fix copies when patching over uncommitted changed (issue2459) 2010-10-28 21:25:53 +02:00
Matt Mackall
fce98d3778 minirst: use colwidth to match title lengths (issue2455) 2010-10-27 15:35:23 -05:00
Matt Mackall
50b99d1a5a encoding: default ambiguous character to narrow
The current implementation of colwidth was treating 'A'mbiguous
characters as wide, which was incorrect in a non-East Asian context.
As per http://unicode.org/reports/tr11/#Recommendations, we should
instead default to 'narrow' if we don't know better. As character
width is dependent on the particular font used and we have no idea
what fonts are in use, this recommendation applies.

This introduces HGENCODINGAMBIGUOUS to get the old behavior back.
2010-10-27 15:35:21 -05:00
Steve Borho
dde38080ab Merge with stable 2010-12-13 12:19:26 -06:00
Martin Geisler
fdfec2742f merge default heads in crew and main 2010-12-13 11:52:52 +01:00
Benoit Boissinot
d2ea44dc59 merge with stable 2010-12-10 23:05:48 +01:00
Matt Mackall
6bcc439bb1 merge with stable 2010-12-08 13:12:12 -06:00
Dan Villiom Podlaski Christiansen
c168860461 make_file: always return a fresh file handle that can be closed
Currently, cmdutil.make_file() will return a freshly made file handle,
except when given a pattern of '-'. If callers would want to close the
handle, they would have to make sure that it's neither sys.stdin or
sys.stdout. Instead, returning a duplicate of either of the two
ensures that make_file() lives up to its name and creates a new
file handle regardless of the input.
2010-12-07 16:08:16 +01:00
Matt Mackall
fd486a3def merge with stable 2010-12-10 19:20:11 -06:00
Augie Fackler
11bc43400a bundle progress: offer best-guess deterministic progress information
This uses the same strategy as progress for pulls, estimating manifests
based on changeset count and estimating file count by files list in
each changeset.
2010-12-10 13:30:37 -06:00
Augie Fackler
ae84cccfbf httpsendfile: record progress information during read()
This allows us to provide deterministic progress information during
transfer of bundle data over HTTP. This is required because we
currently buffer the bundle data to local disk prior to transfer since
wsgiref lacks chunked transfer-coding support.
2010-12-10 13:31:06 -06:00
Alexander Solovyov
b7f3f7f2f4 templatekw.showdiffstat: use ctx.diff() instead of calling patch 2010-12-07 15:50:28 +01:00
Adrian Buehlmann
36da7599cc localrepo: remove unneeded os.unlink call in wwrite
The opener already unlinks the filename before 'w'riting, for both
the symlink and the normal file case. It also now resets the flags
for normal files on 'w'rite, which makes this os.unlink call completely
redundant.

For Windows, removing this extra unlink call helps to avoid tripping
issue2524 (os.unlink followed by a write).
2010-12-10 16:10:14 +01:00
Adrian Buehlmann
15eb1de134 opener: always reset flags on 'w'rite
only the patcher needs to preserve flags on write
2010-12-10 15:14:05 +01:00
Eric Eisner
196def6fd2 subrepo: silence git output when ui.quiet is set 2010-12-09 16:52:14 -05:00
Eric Eisner
4c966e44c6 subrepo: show git command with --debug
Also removing the clutter of --no-pager, since none of these commands use
the pager.
2010-12-09 16:52:14 -05:00
Eric Eisner
ca860bf0f2 subrepo: speed up git push logic
In many common cases where the subrepo is up to date with the remote repo,
hg push will only need to run one git-branch command to see that nothing
needs to be pushed.
2010-12-09 16:52:14 -05:00
Eric Eisner
cb90078af4 subrepo: use subprocess.Popen without the shell
As well as simplifying the code, this makes subprocess calls about 25% faster.
Tested on a couple linux boxes.

python -mtimeit -s'import subprocess' 'subprocess.Popen(
        "git version", shell=True, stdout=subprocess.PIPE).wait()'
python -mtimeit -s'import subprocess' 'subprocess.Popen(
	["git","version"], stdout=subprocess.PIPE).wait()'
2010-12-09 16:52:14 -05:00
Eric Eisner
5cc1a07e5a subrepo: treat git error code 1 as success
At least status, commit, merge-base, and diff all return 1 when not failing.
2010-12-09 16:52:14 -05:00
Eric Eisner
d81be05e6d subrepo: gitsubrepo should inherit from abstractsubrepo 2010-12-09 16:52:14 -05:00
Brodie Rao
1d9f172d6c record: move copystat() hack out of util.copyfile() and into record
226847bf9cab updated copyfile to also copy over atimes and
mtimes. That behavior is specifically to trick editors into thinking
files that hg record has modified haven't changed. We don't really
care about preserving times in the general case.
2010-12-07 20:03:05 +11:00
Dan Villiom Podlaski Christiansen
1c69d6eb9a util: make atomicfiles closable 2010-12-07 16:03:42 +01:00
Eric Eisner
44d5bac715 subrepo: drop arguments unsupported by old git 2010-12-06 21:17:27 -05:00
Eric Eisner
6bdb7bc8d7 subrepo: work around old git's remote naming scheme
Older git versions use 'origin/master'
Current git uses 'remotes/origin/master'
2010-12-06 21:17:27 -05:00
Eric Eisner
6c1163de81 subrepo: use environment variable instead of git commit's --date
Older git versions do not have a --date flag.
2010-12-06 21:17:27 -05:00
Eric Eisner
11aba86609 subrepo: parse git status's human-readable output
Older git versions do not have a machine-readable output, but the default
format has not changed over time.
2010-12-06 21:17:27 -05:00
Eric Eisner
d9f3d5258c subrepo: use subprocess's cwd instead of git's --work-tree
Some older git commands (e.g. git merge) do not properly recognize the
--work-tree argument, so abstract that away from git.
2010-12-06 21:17:27 -05:00
Matt Mackall
4b21988877 bdiff: Fix bogus NULL return 2010-12-06 16:59:43 -06:00
Matt Mackall
338e4487bf bdiff: dynamically allocate hunks
Make the hunk list a singly-linked list rather than a large array.
2010-12-06 16:42:48 -06:00
Eric Eisner
433dad3882 subrepo: lazily update git's local tracking branches
This continues the strategy of separation between hg pull and hg update in
git subrepos by only dealing with git's branches on an update. This behavior
tries to cover the bare essentials of the semantics of git pull in the subrepo
when the parent repo does hg pull and hg update.
2010-11-28 17:19:23 -05:00
Eric Eisner
e82449fedc subrepo: return both mapping directions from gitbranchmap 2010-11-28 15:21:23 -05:00
Eric Eisner
597d9a4df9 subrepo: strip gitcommand output 2010-11-28 15:03:48 -05:00
Dan Villiom Podlaski Christiansen
a0d21ffc4d sshrepo: don't use readline() on the stderr pipe
For some reason, the stat/readline dance suppressed lines following
the first in PyPy 1.4.
2010-12-01 21:46:08 +01:00
Dan Villiom Podlaski Christiansen
312fdcf8d8 demandimport: change default for level from None to -1
The Python default for this function is -1, indicating both relative
and absolute imports should be used.[1] Previously, we relied on the
Python VM not passing level when such semantics were
requisted. This is not the case for PyPy, however, where a level of -1
is always passed to __import__.

[1] <http://docs.python.org/library/functions.html#__import__>
2010-12-01 21:46:08 +01:00
Dan Villiom Podlaski Christiansen
811053b2a4 export: flush the file pointer between patches 2010-12-01 21:46:08 +01:00
Thomas Arendsen Hein
6fd4e6aaec coding style: fix gratuitous whitespace after Python keywords 2010-12-03 11:30:45 +01:00
Matt Mackall
15ad3a76d6 merge with stable 2010-12-01 18:47:40 -06:00
Nicolas Dumazet
7e56ad61ee merge with stable 2010-12-01 11:02:12 +09:00
Martin Geisler
dd0f217423 encoding: fix typo in variable name
The typo had no real effect, except for an unnecessary UTF-8 encoding.
2010-11-29 10:13:55 +01:00
Matt Mackall
776084cff3 pushkey: use UTF-8 2010-11-28 18:21:47 -06:00
Matt Mackall
0d5b6162e5 wireproto: use proper UTF-8 handling for key lookup
Lookups happen in the local encoding space, but the wire protocol
should be using UTF-8 for interoperability.
2010-11-24 16:10:37 -06:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
Matt Mackall
c7059d3926 encoding: add localstr class to track UTF-8 version of transcoded strings
This allows UTF-8 strings to losslessly round-trip through Mercurial
2010-11-24 15:38:52 -06:00
Steve Borho
f938c786bf Merge with stable 2010-11-24 13:43:40 -06:00
Martin Geisler
a30b4f11ad localrepo: move string formatting out of gettext call 2010-11-24 13:25:12 +01:00
Matt Mackall
3fe296798a dirstate: warn on invalid parents rather than aborting
This allows more graceful recovery from some mangled dirstates
2010-11-22 12:43:31 -06:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Eric Eisner
47f74e81de subrepo: lazier git push logic
Avoids calls to git push when the revision is already known to be
in the remote repository. Now, when using a read-only git subrepo,
git will never need to talk to its upstream repository.
2010-11-21 22:00:51 -05:00
Eric Eisner
0e03c676b5 subrepo: archive git subrepos 2010-11-18 19:20:21 -05:00
Patrick Mezard
ad186e82b5 Merge with stable 2010-11-21 13:16:59 +01:00
timeless
f425b70af2 revert: improve merge advice and favor its error over all 2010-11-20 20:41:48 +02:00
Patrick Mezard
4795589405 Merge with stable 2010-11-18 23:15:13 +01:00
Patrick Mezard
4c85200b1f Merge with stable 2010-11-17 21:30:13 +01:00
Erik Zielke
cd95a50630 minirst: improved support for option lists.
This enables minirst to parse and print option lists which have both
long and short options. Before, we could only parse option lists with
long options.
2010-11-02 17:44:19 +01:00
Erik Zielke
87792363c2 minirst: modified minirst to also recognize empty comments.
The modifies minirst to also handle empty comments. An empty comment
is a block with a single line containing two dots.
2010-11-16 13:29:08 +01:00
Martin Geisler
4639d37fbb merge with stable 2010-11-17 09:17:55 +01:00
Martin Geisler
c5a85fb04a minirst: better interaction between comments and margins
You can now split a list with a comment:

  * foo

  .. separator

  * bar

and the two list items will no longer be run together, that is the
output is

  * foo

  * bar

instead of

  * foo
  * bar
2010-11-16 11:10:50 +01:00
Matt Mackall
437f851e8f merge with stable 2010-11-15 17:05:54 -06:00
Adrian Buehlmann
c5ab776a53 discovery: list new remote heads in prepush() on --debug
With this patch applied, Mercurial will list the hashes of new remote heads
if push --debug aborts because of new remote heads (option -f/--force not set).

Example:

  $ hg push --debug repo1
  using http://example.org/repo1
  http auth: user johndoe, password not set
  sending between command
  pushing to http://example.org/repo1
  sending capabilities command
  capabilities: changegroupsubset stream=1 lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN branchmap
  sending heads command
  searching for changes
  common changesets up to 187dd3f0a37d
  sending branchmap command
  new remote heads on branch 'default'        <- new output line
  new remote head 5862c07f53a2                <- new output line
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Compare to without --debug (not changed by this patch, including it here
for reference purposes only):

  $ hg push repo1
  pushing to http://example.org/repo1
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Motivation for this change:

'hg outgoing' may list a whole lot of benign changesets plus an odd changeset
that will trigger the "new remote heads" abort. It can be hard to spot that
single unwanted changeset (it may be an old forgotten experiment, lingering
in the local repo).

"hg log -r 'heads(outgoing())'" might be useful, but that also lists a head
that may be benign on push.

Inside prepush(), we already know which heads are causing troubles on 'hg push'.
Why not make that info available (at least on --debug)?

This would also be helpful for doing remote support, as the supporter can ask
the user to paste the output of 'hg push --debug' on error and then ask further
questions about the heads listed.
2010-11-11 15:51:20 +01:00
Adrian Buehlmann
dcf407e791 discovery: remove erroneous comment in prepush()
New named branches *can* be created without -f/--force by specifying
--new-branch
2010-11-11 15:42:27 +01:00
Eric Eisner
c8106b69bb subrepo: removing (and restoring) git subrepo state 2010-11-14 18:31:40 -05:00
Eric Eisner
7c9ab4f118 subrepo: update and merge works with any git branch 2010-11-14 18:31:29 -05:00
Eric Eisner
22744d6861 subrepo: allow git subrepos to push and merge
(master branch only)

gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:22:33 -05:00
Eric Eisner
244b8e45a7 subrepo: cloning and updating of git subrepos
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:20:13 -05:00
Eric Eisner
579b798395 subrepo: support for adding a git subrepo
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:15:26 -05:00
Nicolas Dumazet
1126494b0f merge with stable 2010-11-13 11:58:51 +09:00
Matt Mackall
d706c5ce4c merge with stable 2010-11-12 01:22:46 -06:00
Martin Geisler
573e60523a merge with stable 2010-11-11 07:23:38 +01:00
Martin Geisler
9d82b9ed1f check-code: using and/or/not as a function is bad style 2010-11-11 00:08:09 +01:00
Martin Geisler
f8298dbc7f merge with stable 2010-11-10 15:44:19 +01:00
Martin Geisler
c0684c364b minirst: link to HelpStyleGuide in docstring 2010-11-10 14:46:13 +01:00
Nicolas Dumazet
1701ac1b51 util: clarify purpose of MBTextWrapper class
It's easy to get confused and scared of an Unicode monster when
skimming through this code: document that this is really just
about column-counting.
2010-11-09 13:43:35 +09:00
Matt Mackall
df921bb32e merge with crew 2010-11-08 17:16:29 -06:00
Nicolas Dumazet
d11d40059b merge with stable 2010-11-09 01:33:48 +09:00
Matt Mackall
970fa59d54 merge with stable 2010-11-07 16:01:57 -06:00
Patrick Mezard
43a1583455 revset: remove unnecessary debug statement 2010-11-07 18:15:17 +01:00
Patrick Mezard
a6f7f2ff05 revset: fix p1, p2 and parents in dirstate case (60aa454e7734)
- Handle 'subset' argument
- Stop returning the null rev from p1 and parents, as in the non-dirstate case
- Order parents as in the non-dirstate case (ascending revs)
2010-11-07 18:14:42 +01:00
Nicolas Dumazet
7adc6dc3ec context: add __repr__ methods to workingfilectx and workingctx 2010-11-07 18:59:27 +09:00
Matt Mackall
9f16ce2e0a merge with stable 2010-11-05 15:38:23 -05:00
Martin Geisler
f930aa4382 merge with stable 2010-11-05 15:35:39 +01:00
Kevin Bullock
e238d72ecb revsets: let parents() return parents of working dir
This patch makes the 'set' argument to revset function parents() optional.
Like p1() and p2(), if no argument is given, returns the parent(s) of the
working directory.

Morally equivalent to 'p1()+p2()', as expected.
2010-11-04 17:09:00 -05:00
Kevin Bullock
63e0b7b699 revsets: let p1() and p2() return parents of working dir
This patch makes the 'set' argument to revset functions p1() and p2()
optional. If no argument is given, p1() and p2() return the first or second
parent of the working directory.

If the working directory is not an in-progress merge (no 2nd parent), p2()
returns the empty set. For a checkout of the null changeset, both p1() and
p2() return the empty set.
2010-11-04 16:59:03 -05:00
Adrian Buehlmann
2d04aa1493 util: refactor opener
- Don't call atomictempfile or nlinks() if the path is malformed
  (no basename). Let posixfile() raise IOError directly.
- atomictempfile already breaks up hardlinks, no need to poke
  at the file with nlinks() if atomictemp.
- No need to copy the file contents to break hardlinks for 'w'rite
  modes (w, wb, w+, w+b). Unlinking and recreating the file is faster.
2010-11-04 09:04:37 +01:00
Matt Mackall
72b5ba88f5 commands: add revset support to most commands 2010-11-04 16:21:28 -05:00
Ronny Pfannschmidt
83cb2b6070 localrepo: make heads use the keyword args of the sorted builtin 2010-11-02 11:25:52 +01:00
Steve Borho
1b8a5c4173 import: add another line feed to message join string
Changeset descriptions are not guaranteed to have a trailing carriage
return.
2010-11-04 11:33:57 -05:00
Patrick Mezard
209debed48 patch: remove unused applydiff() sourcefile argument 2010-11-03 21:11:07 +01:00
Patrick Mezard
0f5ec5ba66 patch: remove unused gitworkdone variable from iterhunks() 2010-11-03 21:11:05 +01:00
Steve Borho
4259758ee2 import: --no-commit should update .hg/last-message.txt
The patch parser goes through all of that trouble extracting the
commit message from the patch file.  It seems such a waste not to
use it.
2010-10-21 16:04:34 -05:00
Gilles Moris
23f58d26b8 log: do case insensitive search for --user option 2010-10-20 15:32:35 +02:00
timeless
2834b35b09 url: show realm/user when asking for username/password 2010-10-26 14:41:58 +03:00
Wagner Bruna
ebc8faba4a help: correct tip about deleting a subrepository
The extra detail is not necessary, and wrong for Mercurial
subrepositories, so remove it (suggested by Patrick Mézard).
2010-10-27 12:13:49 -02:00
Wagner Bruna
1981a0d6f6 revset: fix missing dot in docstring 2010-10-27 12:12:51 -02:00
Wagner Bruna
0913d409a2 help: fix typo in merge-tools topic 2010-10-27 12:03:08 -02:00
Wagner Bruna
2bff625586 i18n: translate revset predicate docstrings 2010-10-26 23:51:01 -02:00
Mads Kiilerich
eaea535bf7 subrepo: propagate non-default pull/push path to relative subrepos (issue1852) 2010-10-27 00:28:40 +02:00
Kevin Bullock
15da3ac7f2 pull: silence spurious 'requesting all changes' message
When issuing `hg pull -r REV` in a repo with no common ancestor with the
remote repo, the message 'requesting all changes' is printed, even though only
the changese that are ancestors of REV are actually requested. This can be
confusing for users (see
http://www.selenic.com/pipermail/mercurial/2010-October/035508.html).

This silences the message if (and only if) the '-r' option was passed.
2010-10-20 17:38:21 -05:00
Pradeepkumar Gayam
226f2a834c templates: fix inconsistency in 'help' link 2010-10-26 02:38:14 +05:30
Martin Geisler
534ae9133c lsprof: remove #!-line from non-executable script
It triggered an rpmlint error, reported by Neal Becker.
2010-10-25 23:46:26 +02:00
Steve Borho
7b316e89b0 help: improve wording of internal:merge and internal:fail 2010-10-25 14:34:49 -05:00
Matt Mackall
4d7b056fed traceback: point to BugTracker on the wiki 2010-10-25 13:06:37 -05:00
Matt Mackall
b6427b4a0a version: replace email address with url to reduce private mail 2010-10-24 16:02:10 -05:00
Patrick Mezard
4f21d24f6f Add subrepos help topic
Edited by:
Martin Geisler <mg@lazybytes.net>
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
2010-10-24 19:28:44 +02:00
Patrick Mezard
d96f85f343 merge-tools.txt: 6 comes after 5 2010-10-24 18:37:59 +02:00
Patrick Mezard
88ff8c9a1e Test applying context diffs 2010-10-24 12:56:38 +02:00
Patrick Mezard
90ed7bf6a1 merge-tools.txt: fix typos, simplify, renumber from 1. 2010-10-24 12:55:29 +02:00
Patrick Mezard
3fd83b5b68 hggettext: handle i18nfunctions declaration for docstrings translations 2010-10-24 12:52:37 +02:00
Patrick Mezard
c832c42c0c revsets: generate predicate help dynamically 2010-10-23 19:21:51 +02:00
Patrick Mezard
88087f644b help: add topic rewriting hooks
They are useful when updating help topics dynamically from extensions.
2010-10-23 19:21:49 +02:00
Martin Geisler
98ed55bc01 minirst: ignore comments 2010-10-23 17:30:08 +02:00
Martin Geisler
5afa27a390 help: add "revset" alias for "revsets" help topic 2010-10-23 17:45:49 +02:00
Martin Geisler
3ef0b64b6f revset: add translator comments to i18n strings 2010-10-23 14:59:19 +02:00
Steve Borho
e74d5a4302 backout: add --tool argument for specifying merge tool 2010-10-22 11:58:43 -05:00
Mads Kiilerich
1c09b9028f help: improve merge-tools topic, describe --tool and clarify details
This doesn't make it simpler, but it makes it more correct.

With help from erikz, mg and abuehl.
2010-10-22 17:08:15 +02:00
Mads Kiilerich
aee658b0d9 help: use Windows cmd compatible quoting in revset help 2010-10-22 17:05:51 +02:00
Martin Geisler
7e2dd66daa merge-tools: fixed typos
Spotted by Patrick Mézard.
2010-10-21 21:34:30 +02:00
Martin Geisler
9a658564bb commands: mark tip:0 as literal text
If left unquoted, this is seen as a link to '0' using protocol 'tip'
because of some over-eager link-finding magic in Docutils.
2010-10-21 21:26:32 +02:00
Steve Borho
0ef8d80996 demandimport: backout 907b6ae6f918
Using a keyword argument here breaks zipimporter for at least some
versions of Python2.6 on Windows.
2010-10-21 10:13:03 -05:00
Martin Geisler
b7a041ed06 dispatch: backout 3b699ee0e66d
The parenthesis may need translation too: Laurens Holst pointed out
that Japanese uses full-width parentheses: () (U+FF08 U+FF09).
2010-10-21 11:23:26 +02:00
Martin Geisler
0305929afc subrepo: svnsubrepo._wcrev should return str after 62328a9d763a 2010-10-21 10:54:37 +02:00
Matt Mackall
0677d9a163 subrepo: fix status check on SVN subrepos (issue2445) 2010-10-21 03:28:51 -05:00
Mads Kiilerich
edd19f159b hgweb: let HTTPS serve use more compatible and less secure encryption
PROTOCOL_SSLv3 on the server side doesn't work everywhere. Sometimes the client
reports "EOF occurred in violation of protocol" (for example on Mac and Solaris).

The more compatible PROTOCOL_SSLv23 is now used instead. It works but is less
"secure" for some OpenSSL versions as it can fall back to weak encryption.
2010-10-21 03:18:52 +02:00
Steve Borho
6a890aa672 Merge with mpm 2010-10-20 15:36:42 -05:00
Steve Borho
a3baf6a2e7 merge: implement --tool arguments using new ui.forcemerge configurable
ui.forcemerge is set before calling into merge or resolve commands, then unset
to prevent ui pollution for further operations.

ui.forcemerge takes precedence over HGMERGE, but mimics HGMERGE behavior if the
given --tool is not found by the merge-tools machinery.  This makes it possible
to do:  hg resolve --tool="python mymerge.py" FILE

With this approach, HGMERGE and ui.merge are not harmed by --tool
2010-10-19 22:33:52 -05:00
Mads Kiilerich
affe4fdcad hgweb: use Pythons ssl module for HTTPS serve when using Python 2.6 or later
pyOpenSSL apparently doesn't work for Python 2.7 and isn't very actively
maintained.

The built-in ssl module seems like a long-term winner, so we now use that with
Python 2.6 and higher.
2010-10-20 20:19:34 +02:00
Mads Kiilerich
1edb529392 hgweb: refactor all pyOpenSSL references into one class 2010-10-20 20:19:32 +02:00
Erik Zielke
1c7a5f9d36 extensions.load: return module
Makes extensions.load return the module that
it has loaded.

This is done so that callers can get information on this module, which
e.g. can be used for generating docs.
2010-10-19 13:43:40 +02:00
Wagner Bruna
7ca1d483b2 cmdutil: mark string for i18n 2010-10-20 12:29:41 -02:00
Wagner Bruna
d4398837df revset: disable subset optimization for parents() and children() (issue2437)
For the boolean operators, the subset optimization works by calculating
the cheaper argument first, and passing the subset to the second
argument to restrict the revision domain. This works well for filtering
predicates.

But parents() don't work like a filter: it may return revisions outside the
specified set. So, combining it with boolean operators may easily yield
incorrect results. For instance, for the following revision graph:

0 -- 1

the expression '0 and parents(1)' should evaluate as follows:

0 and parents(1) ->
0 and 0 ->
0

But since [0] is passed to parents() as a subset, we get instead:

0 and parents(1 and 0) ->
0 and parents([]) ->
0 and [] ->
[]

This also affects children(), p1() and p2(), for the same reasons.
Predicates that call these (like heads()) are also affected.

We work around this issue by ignoring the subset when propagating
the call inside those predicates.
2010-10-15 03:30:38 -03:00
Erik Zielke
9ef6ae89b7 help: help topic for merge tools
I have made a help topic for merge tools. The text in the topic is
based on the http://mercurial.selenic.com/wiki/MergeProgram page from
the wiki, along with some extra information on the internal merge tools.
2010-10-20 16:54:34 +02:00
Martin Geisler
77ce66fb6a check-code: find trailing whitespace 2010-10-20 10:13:04 +02:00
Steve Borho
c299e2623a merge: when --tool is specified, disable HGMERGE by setting to empty string
HGMERGE has different semantics than ui.merge.  HGMERGE should hold the name
on an executable in your path, or an absolute tool path.  As such, it's not
safe to simply copy the user's specified --tool value into HGMERGE.  Instead,
we disable HGMERGE by setting it to an empty string.
2010-10-18 23:20:14 -05:00
Nicolas Dumazet
d31f4fef82 ui: only fix config if the relevant section has changed
In particular, when extensions add hooks, or add non-ui and non-paths
configuration items during their setups, we really have no reason
to re-"fix" the config dictionaries.
2010-10-18 14:10:36 +09:00
Benoit Boissinot
8af083904d discovery: findincoming() is no longer used 2010-10-17 22:24:26 +02:00
Benoit Boissinot
35eccd5baa discovery: use set instead of dict 2010-10-17 19:25:35 +02:00
Benoit Boissinot
52e06cf01f discovery: remove unused "base" argument from find.*incoming() 2010-10-17 16:16:12 +02:00
Benoit Boissinot
afac0ba765 discovery: do not use the implicit updating of the "base" arg 2010-10-09 17:16:39 -05:00
Nicolas Dumazet
9eb3896291 tags: do not fail if tags.cache is corrupted (issue2444)
This file is not critical for hg, so we can safely
swallow the ValueError
2010-10-19 20:20:10 +09:00
Dan Villiom Podlaski Christiansen
17cfc8fdc9 merge: make 'diverging renames' diagnostic a more helpful note.
See the Hg Book on why we actually want to detect this case:
http://hgbook.red-bean.com/read/mercurial-in-daily-use.html#id364290

Before:

$ hg up deadbeef
warning: detected divergent renames of X to:
...

After:

$ hg up deadbeef
note: possible conflict - X was renamed multiple times to:
...

No functionality change.
2010-10-10 09:50:25 -05:00
Adrian Buehlmann
b9ef72891e Revert: capitalization doc fix 2010-10-17 00:45:34 +02:00
Mads Kiilerich
fd086af9b7 subrepo: abort instead of pushing/pulling to the repo itself
_abssource will now abort (or return None) in the rare cases where no push/pull
path can be found.
2010-10-19 03:56:20 +02:00
Mads Kiilerich
9c4dc8c331 subrepo: rename relpath to subrelpath and introduce reporelpath 2010-10-19 03:55:28 +02:00
Mads Kiilerich
35ef3c1409 mdiff: carriage return (\r) is also ignorable whitespace 2010-10-19 03:55:06 +02:00
Steve Borho
e484985865 merge: add --tool argument to merge and resolve
These arguments are shorthand for --config ui.merge, but they also
override HGMERGE if it is found in the user's environment.
2010-10-15 23:00:45 -05:00
Steve Losh
0224e99d28 alias: fail gracefully when invalid global options are given (issue2442)
This patch modifies the check for shell aliases to prevent crashing when an invalid
global option is given.

When an invalid global option is given the check will simply return and let the
normal error handling for this case happen.
2010-10-17 13:24:37 -04:00
timeless
ad9a9b223b merge/progress: marking strings for localization 2010-08-02 07:15:47 +03:00
timeless
d78a15767f verify/progress: using gerund to indicate action and adding units 2010-08-02 07:15:47 +03:00
Mads Kiilerich
70b420d9b9 url: validity (notBefore/notAfter) is checked by OpenSSL (issue2407)
Removing the check from our code makes https with cacerts check work with
Python < 2.6.
2010-10-17 04:14:06 +02:00
Mads Kiilerich
c627f511ce serve: fix https mode and add test
The https mode failed in super because BaseRequestHandler is an old-style
class.

This introduces the first test of https client/server functionality - and
"hghave ssl". The test is currently only run on Python 2.6.
2010-10-17 04:13:35 +02:00
Augie Fackler
4ec8b25214 hgweb: don't send a body or illegal headers during 304 response
Without this fix, mod_wsgi and spawning get in a wedged state after
sending a 304 response. Not sending a body fixed that problem. The
header change was discovered by using wsgiref.validate.validator to
check for other errors.
2010-10-16 17:29:04 -05:00
Benoit Boissinot
d7dc2daaa0 revset: use 'requires' instead of 'wants' in error message 2010-10-16 18:50:53 +02:00
Nicolas Dumazet
6b618a96de outgoing: unify common graphlog.outgoing and hg.outgoing code 2010-10-15 05:21:51 +02:00
Nicolas Dumazet
15e204f50d bundlerepo: unify common code into a new getremotechanges
The pattern where we fetch incoming remote changes and return
them as a local bundlerepo seems common. It's nicer to have this
code unified.
2010-10-14 22:41:43 +02:00
Augie Fackler
0e09df5a9e revset id(): fix error text to say "id wants..." instead of "rev wants..." 2010-10-12 23:33:43 -05:00
Christian Ebert
7790af9438 context: narrow down filter special case in filectx.cmp()
cmp via filelog when encode filters are present, but only when
actually comparing to the working directory.
2010-10-14 22:47:50 +02:00
Nicolas Dumazet
171049119e incoming: unify code for incoming and graphlog.incoming 2010-10-14 21:36:00 +02:00
Nicolas Dumazet
631a3bb472 incoming: rename variable
Groundwork so that incoming and graphlog.incoming code look the same and get
easier to unify.
2010-10-14 21:37:00 +02:00
Mads Kiilerich
287d9de60b import: only the first hg patch marker should be processed (issue2417)
Proper use of the hgpatch state variable had been lost in the final edits of
6f45596f715c - now it works more like intended.
2010-10-14 01:28:29 +02:00
Gilles Moris
16cffc19ee backout: provide linear backout as a default (without --merge option)
This changes backouts changeset to retain linear history, .e. it is committed
as a child of the working directory parent, not the reverted changeset
parent.

The default behavior was previously to just commit a reverted change as a
child of the backed out changeset - thus creating a new head. Most of
the time, you would use the --merge option, as it does not make sense to
keep this dangling head as is.
The previous behavior could be obtained by using 'hg update --clean .' after a
'hg backout --merge'.

The --merge option itself is not affected by this change. There is also
still an autocommit of the backout if a merge is not needed, i.e. in case
the backout is the parent of the working directory.

Previously we had (pwd = parent of the working directory):
                  pwd     older
backout           auto    merge
backout --merge   auto    commit

With the new linear approach:
                  pwd     older
backout           auto    commit
backout --merge   auto    commit

auto: commit done by the backout command
merge: backout also already committed but explicit merge and commit needed
commit: user need to commit the update/merge
2010-09-10 10:28:18 +02:00
Augie Fackler
457b3d77e0 update: use revsingle to enable use of revsets as update targets (issue1993) 2010-10-11 10:07:42 -05:00
Augie Fackler
5fe5470142 revset: add id() and rev() to allow explicitly referring to changes by hash or rev 2010-10-11 09:44:19 -05:00
Augie Fackler
4a386faa07 revset: rename tagged() to tag() and allow it to take an optional tag name 2010-10-10 12:41:36 -05:00
Augie Fackler
da95a50bed hgweb help: fix double help links 2010-10-10 12:03:28 -05:00
Nicolas Dumazet
04cf1f6b57 filectx: use ctx.size comparisons to speed up ctx.cmp
Comparing sizes is cheaper than comparing file contents, as it does not
involve reading the file on disk or from the filelog.

It is however not always possible: some extensions, or encode filters,
change data when extracting it to the working directory.
2010-07-27 23:07:30 +09:00
Nicolas Dumazet
a926c48681 localrepo: use propertycaches to access encode/decode filters 2010-10-10 18:58:45 +02:00
Nicolas Dumazet
9d6722b6ec localrepo: load filter patterns outside of _filter 2010-10-10 19:10:16 +02:00
Nicolas Dumazet
90090e9482 localrepo: have _loadfilter return the loaded filter patterns 2010-10-10 19:07:58 +02:00
Benoit Boissinot
19dff6e720 merge with mpm 2010-10-11 13:26:29 -05:00
Benoit Boissinot
9bd037b429 wireproto/http: drain the incoming bundle in case of errors 2010-10-11 12:47:11 -05:00
Benoit Boissinot
16e11c728a wireproto: introduce pusherr() to deal with "unsynced changes" error
The behaviour between http and ssh still differ:
- the "unsynced changes" is seen as a remote output in the http cases
- but it is correctly seen as a push error for ssh
2010-10-11 12:45:36 -05:00
Benoit Boissinot
d2a82b6bc1 wireproto: redirect the output earlier 2010-10-11 12:44:33 -05:00
Benoit Boissinot
2a6248535c wireproto: return in finally was messing with the return inside the block 2010-10-11 12:44:11 -05:00
Dirkjan Ochtman
5cfefa5c93 commands: add move alias for the rename command
svn provides move, and it's also a standard tool on Windows.
2010-10-11 13:49:53 +02:00
Matt Mackall
a3ff3a53e2 util: make wrap() require a width argument
This keeps hgweb's help engine from poking at file descriptors that
don't exist.
2010-10-10 18:02:52 -05:00
Brodie Rao
78b26c82ec showconfig: don't accept multiple sections and one config item
Showconfig now behaves as documented and only accepts one section.name argument
or a number of section names.
2010-10-09 16:55:33 -05:00
Matt Mackall
60aea94981 hgweb: another fix for the help termwidth bug 2010-10-10 17:35:28 -05:00
Matt Mackall
d12e3634d3 hgweb: more ui fiddling 2010-10-10 11:05:06 -05:00
Augie Fackler
8969884a91 hgweb: fix hgweb_mod as well as hgwebdir_mod 2010-10-10 10:42:44 -05:00
Augie Fackler
dd4bc6e0c2 hgwebdir_mod: use fake termwidth to avoid mod_wsgi's wrath 2010-10-10 10:07:17 -05:00
Augie Fackler
42c8b2cf07 termwidth: move to ui.ui from util 2010-10-10 10:06:36 -05:00
Kevin Bullock
3d8e7943fe help: improve description of update --check 2010-10-07 23:34:21 -05:00
Adrian Buehlmann
04f7530508 store: encode first period or space in filenames (issue1713)
- Mac OS X has problems with filenames starting with '._'
  (e.g. '.FOO' -> '._f_o_o' is now encoded as '~2e_f_o_o')

- Explorer of Windows Vista and Windows 7 strip leading spaces of
  path elements of filenames when copying trees

Above problems are avoided by encoding the first space (as '~20') or
period (as '~2e') of all path elements.

This introduces a new entry 'dotencode' in .hg/requires, that is,
a new repository filename layout (inside .hg/store).

Newly created repositories require 'dotencode' by default. Specifying

  [format]
  dotencode = False

in a config file will use the old format instead.

Prior Mercurial versions will abort with the message

   abort: requirement 'dotencode' not supported!

when trying to access a local repository that requires 'dotencode'.

New 'dotencode' repositories can be converted to the previous
repository format with

  hg --config format.dotencode=0 clone --pull repoA repoB
2010-10-09 21:54:50 +02:00
Dan Villiom Podlaski Christiansen
4b3349db92 demandimport: fix an obscure corner-case.
Python's __import__() function has 'level' as the fourth argument, not the
third. The code path in question probably never worked.

(This was seen trying to run Mercurial in PyPy. Fixing this made it
die somewhere else...)
2010-09-14 23:00:39 +02:00
Dan Villiom Podlaski Christiansen
cff327a7f7 copies: don't detect copies as "divergent renames"
(For the purposes of this patch copy is defined as a rename where the
source continues to exist.)
2010-10-10 09:48:37 -05:00
Brodie Rao
2187fcb2bb update: use higher level wording for "crosses branches" error
When using "hg update" to update to a revision on another branch, if
the user has uncommitted changes in the working directory, hg aborts
with the following message:

  abort: crosses branches (use 'hg merge' to merge or use 'hg update
  -C' to discard changes)

If the user isn't trying to update to tip and they follow the command
examples verbatim, they would end up updating to the wrong revision.

This patch removes the command examples in favor of just telling the
user to either merge or use --clean:

  abort: crosses branches (merge branches or use --clean to discard
  changes)

hg also aborts if the user tries to use "hg update" to get to tip
(without specifying a revision) and tip is on another branch:

  abort: crosses branches (use 'hg merge' or use 'hg update -c')

This message is changed in the same fashion:

  abort: crosses branches (merge branches or use --check to force
  update)
2010-10-09 17:02:28 -05:00
Augie Fackler
954949fd67 hgweb: add help link to templates missed in 333983876439 2010-10-09 17:58:48 -05:00
Patrick Mezard
01e8f53ff7 patch: fails immediately upon malformed hunk
patch(1) does silently ignore malformed hunks but this is not something we want
to copy.
2010-10-09 15:13:08 -05:00
Patrick Mezard
095f60fafa patch: always raise PatchError with a message, simplify handling 2010-10-09 15:13:08 -05:00
Patrick Mezard
b52c9228ba patch: simplify externalpatch() arguments 2010-10-09 15:13:08 -05:00
Patrick Mezard
9765952244 util: remove needbinary(), no longer used for external patching 2010-10-09 15:13:08 -05:00
Patrick Mezard
61a67cb90e patch: remove internal patcher fallback and NoHunk error
By now the internal patcher is probably more reliable than anything we might
find on the command line.
2010-10-09 15:13:08 -05:00
Patrick Mezard
f0b64b2f9a patch: remove unused patchmeta.lineno 2010-10-09 15:13:08 -05:00
Patrick Mezard
3c601e6ebf patch: remove unused flags from readgitpatch() 2010-10-09 15:13:08 -05:00
Martin Geisler
ae6f6bb2ab revsets: fix stray * in help topic 2010-10-09 22:05:24 +02:00
Augie Fackler
1978da6b24 web: add a help view for getting hg help output 2010-10-09 12:27:14 -05:00
Benoit Boissinot
e73a57d28e fix indentation error 2010-10-09 15:00:30 -05:00
Matt Mackall
bc4d4ff1d1 merge: handle no file parent in backwards merge (issue2364) 2010-10-09 14:50:20 -05:00
Benoit Boissinot
e5538ef2cc ui.paths: expand paths directly in fixconfig (issue2373)
var and home expansion should be done first.
2010-10-09 12:28:16 -05:00
Brodie Rao
915907e184 revsets: add a sample query to the help for getting active branches 2010-10-09 11:55:25 -05:00
Brodie Rao
e9092c74c1 revsets: add descriptions for sample queries in the help 2010-10-09 11:54:42 -05:00
Brodie Rao
e6cef43d44 revsets: clarify in the help that head() returns named branch heads 2010-10-09 11:27:29 -05:00
Martin Geisler
428161f105 minirst: pull admonition titles out formatblock function 2010-10-08 23:23:49 +02:00
Martin Geisler
172cccbec3 minirst: refactor/simplify findblocks 2010-10-08 23:19:26 +02:00
Mads Kiilerich
227683e7b5 import: don't strip '#' lines from patch descriptions (issue 2417)
Previously no '# ' lines came through the parser.

Now only the first '# ' lines are processed, from '# HG changeset patch' and to
the first line not starting with '# '.
2010-10-08 23:39:44 -05:00
Brodie Rao
95903377bf dispatch: properly handle relative path aliases used with -R (issue2376)
This ensures the repo config is read relative to the repo root during
dispatch.
2010-10-04 15:07:12 -05:00
Brodie Rao
4236676bfc dispatch: remove superfluous try/except when reading local ui config
ui.readconfig() already handles IOError in this case.
2010-10-04 14:26:38 -05:00
Steve Losh
a6ad45cc76 alias: back up and restore commands.norepo before checking for shell aliases 2010-10-08 16:10:00 -04:00
Benoit Boissinot
e33ea43988 revlog.addgroup(): always use _addrevision() to add new revlog entries
This makes parentdelta clone support pulling.
2010-10-08 18:00:19 -05:00
Benoit Boissinot
617749c5ab revlog._addrevision(): allow text argument to be None, build it lazily 2010-10-08 18:00:16 -05:00
Benoit Boissinot
657ba912ee changegroupsubset: use readdelta() fast path when delta is against a parent 2010-10-08 18:00:15 -05:00
Martin Geisler
0758677299 minirst: small code cleanup 2010-10-08 22:42:32 +02:00
Brodie Rao
ff59218cc1 cat: fix cat without -r, broken by 5089d555cee9
The default revision for revsingle() is now '.' instead of None. This
preserves the behavior of cat prior to it using revsingle().
2010-10-08 14:02:23 -05:00
Matt Mackall
9ccbd76ee4 revsets: introduce revsingle helper
revsingle returns a context for the last revision of the supplied revspec
2010-10-07 18:24:29 -05:00
Matt Mackall
223b7c03b1 revsets: make revpair revsets-aware
revpair returns the first and last members of the computed revset(s)
2010-10-07 18:05:04 -05:00
Matt Mackall
67a62aa820 revset: lower precedence of minus infix (issue2361) 2010-10-07 11:45:17 -05:00
Henrik Stuart
e96bfa211b merge with stable 2010-10-05 20:25:51 +02:00
Adrian Buehlmann
5fa66b2722 revset: fix #branch in urls for outgoing()
hg log -r 'outgoing(..)' ignored #branch in some cases.
This patch fixes it.

The cases where it misbehaved are now covered by the added
test-revset-outgoing.t
2010-10-05 11:34:13 +02:00
Martin Geisler
922824bfe1 heads: mention STARTREV in synopsis and help for --rev
Before this change, "hg help heads" said

  hg heads [-ac] [-r REV] [REV]...

      [...]
      If STARTREV is specified, only those heads that are descendants
      of STARTREV will be displayed.
      [...]

   -r --rev REV       show only heads which are descendants of REV
   [...]

which made little sense since there are two things called REV in the
synopsis and nothing called STARTREV.

A little digging reveals that the "[-r REV]" part of the synopsis was
introduced in 3acdabb0ef1d, changed to "[-r STARTREV]" in
68df96e9e749, and then changed back to "[-r REV]" in 5c78ba00bf0c.

The last change seems to be based on a patch[1] on our mailinglist
that actually *inserted* STARTREV again in the help for the command
line option itself. For some reason, the patch was changed to remove
STARTREV from the synopsis.

This change finally makes the help consistent by putting STARTREV back
into the help in all places where it is needed:

  hg heads [-ac] [-r STARTREV] [REV]...

      [...]
      If STARTREV is specified, only those heads that are descendants
      of STARTREV will be displayed.
      [...]

   -r --rev STARTREV  show only heads which are descendants of STARTREV
   [...]

This was not possible until 7ba070acb8f7, which introduced the
possibility of naming the meta variables for each option.

[1]: http://mercurial.markmail.org/message/qgc55gd4fam4ogvz
2010-10-01 23:16:11 +02:00
Martin Geisler
a82d25297a merge with stable 2010-10-01 16:43:03 +02:00
Martin Geisler
08e5ff349e url: mark certificate error string for translation 2010-10-01 16:08:46 +02:00
Mads Kiilerich
665d2722d8 doc: clarify that https cert verification requires web.cacerts 2010-10-01 00:48:50 +02:00
Mads Kiilerich
916b2a0e20 url: verify correctness of https server certificates (issue2407)
Pythons SSL module verifies that certificates received for HTTPS are valid
according to the specified cacerts, but it doesn't verify that the certificate
is for the host we connect to.

We now explicitly verify that the commonName in the received certificate
matches the requested hostname and is valid for the time being.

This is a minimal patch where we try to fail to the safe side, but we do still
rely on Python's SSL functionality and do not try to implement the standards
fully and correctly. CRLs and subjectAltName are not handled and proxies
haven't been considered.

This change might break connections to some sites if cacerts is specified and
the certificates (by our definition) isn't correct. The workaround is to
disable cacerts which in most cases isn't much worse than it was before with
cacerts.
2010-10-01 00:46:59 +02:00
Patrick Mezard
a8f024ef25 patch: test and document a bit binary to regular file upgrade 2010-09-28 00:41:08 +02:00
Patrick Mezard
a9686ec545 patch: upgrade to git patch when removing binary file
Otherwise it may cause data loss when removing binary files in mq with
--git=auto.
2010-09-28 00:41:07 +02:00
Patrick Mezard
5468157807 patch: fix rename text to binary file (issue2400) 2010-09-27 22:47:10 +02:00
Mads Kiilerich
2fcbe3473c merge with stable 2010-10-01 00:54:03 +02:00
Mads Kiilerich
11c8cc29c9 init: expand destination url as a configured paths
Most commands expands configured paths when repositories are specified, just as
the urls help says. Clone also expands the destination path. Clone is morally
equivalent to init + push/pull, so init should also expand the destination path
- and that is what this patch makes it do.

There is no really good usecases for this and in most cases it doesn't matter,
but consistency is nice, and otherwise we would have to document the exception.
2010-09-29 01:32:51 +02:00
Mads Kiilerich
afaab15e7e serve: let --web-conf help reference hgweb 2010-09-29 01:32:50 +02:00
Patrick Mezard
df877501f1 Merge with stable 2010-09-28 01:11:24 +02:00
Matt Mackall
e06b83d527 merge with stable 2010-09-27 10:48:50 -05:00
Ry4an Brase
87ae742f5e Correct Content-Type header values for archive downloads.
The content type for both .tar.gz and .tar.bz2 downloads was
application/x-tar, which is correct for .tar files when no
Content-Encoding is present, but is not correct for .tar.gz and .tar.bz2
files unless Content-Encoding is set to gzip or x-bzip2, respectively.

However, setting Content-Encoding causes browsers to undo that encoding
during download, when a .gz or .bz2 file is usually the desired
artifact.  Omitting the Content-Encoding header is preferred to avoid
having browsers uncompress non-render-able files.

Additionally, the Content-Disposition line indicates a final desired
filename with .tar.gz or .tar.bz2 extension which makes providing a
Content-Encoding header inappropriate.

With the current configuration browsers (Chrome and Firefox thus far)
are registering the application/x-tar Content-Type and not .tar
extension and appending that extension, yielding filename.tar.gz.tar as
a final on-disk artifact.  This was originally reported here:
http://stackoverflow.com/questions/3753659

I've changed the .tar.gz and .tar.bz2 Content-Type values to
application/x-gzip and application/x-bzip2, respectively.  Which yields
correctly named download artifacts on Firefox, Chrome, and IE.
2010-09-20 14:56:08 -05:00
Alexandre Fayolle
55241e7f70 Fix memory leak when using hg commands over http repositories
When using hg commands over an http repository in a long running process, a
httphandler instance is leaked for each command, because of a loop
handler.parent -> OpenerDirector and OpenerDirector.handlers -> handler which
is not handled by Python's gc. Discussion on #mercurial concluded that removing
the __del__ method solved the problem.
2010-09-23 11:41:27 +02:00