Commit Graph

23246 Commits

Author SHA1 Message Date
Martin von Zweigbergk
242bbe216d addremove: print relative paths when called with -I/-X (BC)
For "hg addremove 'glob:*.py'", we print any paths added or removed as
relative to the current directory, but when "hg addremove -I
'glob:*.py'" is used, we use the absolute path (relative from the repo
root). It seems like they should be the same, so change it so we use
relative paths in both cases. Continue to use absolute paths when no
patterns are given.
2014-12-01 21:48:32 -08:00
Matt Mackall
289d6b53bc merge with stable 2014-12-01 19:34:11 -06:00
Matt Mackall
f37609509f merge with i18n 2014-12-01 18:51:10 -06:00
Matt Mackall
57db67f921 Added signature for changeset 99b29d2bd5ed 2014-12-01 18:39:19 -06:00
Wagner Bruna
3b892bfd69 i18n-pt_BR: synchronized with a05dbabaa7d7 2014-12-01 11:21:30 -02:00
Mads Kiilerich
4c4b1f5ddd merge: before cd/dc prompt, check that changed side really changed
Before, merging would in some cases ask "wrong" questions about
"changed/deleted" conflicts ... and even do it before the resolve phase where
they can be postponed, re"resolved" or answered in bulk operations.

Instead, check that the content of the changed file really did change.

Reading and comparing file content is expensive and should be avoided before
the resolve phase. Prompting the user is however even more expensive. Checking
the content here is thus better.

The 'f in ancestors[0]' should not be necessary but is included to be extra
safe.
2014-12-01 02:30:21 +01:00
Mads Kiilerich
0619283698 largefiles: don't show largefile/normal prompts if one side is unchanged 2014-12-01 02:11:29 +01:00
Mads Kiilerich
99f8557b66 tests: add test-issue3084.t cases for 'changed but same' as for 'unchanged'
Use suffix -same for cases where file changed but content is the same - that is
the case where manifestmerge doesn't detect that a file is unchanged.

(The suffix -id is already used for cases where the file didn't change - that
is the trivial case where manifestmerge detects that the file is unchanged.)

These new tests are good but the results are bad. There shouldn't be any merge
conflicts or prompts when one side didn't change.
2014-12-01 02:11:17 +01:00
Mads Kiilerich
ad85c54a44 tests: clean-up of largefiles tests in test-issue3084.t
Prepare for adding more test cases to the systematic testing, moving the test
from dcd04c26c0f8 to another section.
2014-12-01 02:10:57 +01:00
Pierre-Yves David
1e785e1322 pushkey: gracefully handle prepushkey hook failure (issue4455)
This allow to gracefully report the failure of the bookmark push and carry on.
Before this change set. Local push would plain quit and wireprotocol would
failed in various ungraceful way.
2014-11-29 19:17:47 -08:00
Pierre-Yves David
6cf24b99de hook: raise a more specialized HookAbort exception when a hook fails
We need to gracefully handle some aborts for pushkey, especially
because it leads to a user-facing crash over the wireprotocols. So we
need a more specialized exception to catch.
2014-11-29 19:13:35 -08:00
Matt Mackall
c8d5dc5d96 help: fix typo in files help 2014-12-01 15:04:34 -06:00
Pierre-Yves David
56b039c98c revset: fix first and last for generatorset (issue4465)
The code was just plain wrong.
2014-12-01 05:18:12 -08:00
FUJIWARA Katsunori
43f343827a i18n-ja: synchronized with 4b491ac93c5c 2014-11-29 14:32:12 +09:00
Mathias De Maré
76a33af9ab subrepo: add status support for ignored files in git subrepos
Retrieving the status of a git subrepo did not show ignored
files. Using 'git ls-files', we can retrieve these files
and display the correct status.
2014-11-28 20:16:15 +01:00
Mads Kiilerich
a5440bd8ed mq: fix update of headers that occur in the "wrong" order
Mq tried to insert headers in the right order. Sometimes it would stop
searching before checking all headers and it could thus duplicate a header
instead of replacing it.
2014-11-28 02:57:33 +01:00
Gregory Szorc
9ccf5570f8 hgweb: send proper HTTP response after uncaught exception
This patch fixes a bug where hgweb would send an incomplete HTTP
response.

If an uncaught exception is raised when hgweb is processing a request,
hgweb attempts to send a generic error response and log that exception.

The server defaults to chunked transfer coding. If an uncaught exception
occurred, it was sending the error response string / chunk properly.
However, RFC 7230 Section 4.1 mandates a 0 size last chunk be sent to
indicate end of the entity body. hgweb was failing to send this last
chunk. As a result, properly written HTTP clients would assume more data
was coming and they would likely time out waiting for another chunk to
arrive.

Mercurial's own test harness was paving over the improper HTTP behavior
by not attempting to read the response body if the status code was 500.
This incorrect workaround was added in faced8f5c2af and has been removed
with this patch.
2014-11-28 10:59:02 -08:00
Pierre-Yves David
c52ad3f03b manifest: document the extra letter in working copy manifest node
As the second developer to get confused by this in November, I'm adding some
documentation for the next poor soul.
2014-11-26 15:37:01 -08:00
Mads Kiilerich
0200eddaff tests: test rebase of merge of target ancestors 2014-11-30 20:06:53 +01:00
Mads Kiilerich
ed574ecff8 tests: test coverage of parent order with p1 outside rebase set 2014-11-30 19:36:03 +01:00
Mads Kiilerich
25174ff1f2 tests: add test for rebasing merges with ancestors of the rebase destination
This shows sub-optimal behaviour. The user gets a merge prompt that it is very
hard to justify.
2014-11-30 19:35:54 +01:00
Mads Kiilerich
9389b9fa07 merge: 0 is a valid ancestor different from None
Most internal functions can take either a hash or an integer. Merge did however
not handle 0 as revision 0. Now it does.
2014-11-30 19:26:53 +01:00
Matt Mackall
4abfc94f18 merge with stable 2014-11-27 12:25:01 -06:00
Pierre-Yves David
2d599c1c7d revert: look for copy information for all local modifications
Renaming a file over an existing one marks the file as modified. So we
track rename source in modified file too.
2014-11-25 19:40:54 -08:00
Pierre-Yves David
8db67ed78a rename: properly report removed and added file as modified (issue4458)
The result of 'hg rm' + 'hg rename' disagreed with the one from
'hg rename --force'. We align them on 'hg move --force' because it agrees with
what 'hg status' says after the commit.

Stopping reporting a modified file as added puts an end to the hg revert confusion in this
situation (issue4458).

However, reporting the file as modified also prevents revert from restoring the copy
source. We fix this in a later changeset.

Git diff also stop reporting the add in the middle of the chain as add. Not
sure how important (and even wrong) it is.
2014-11-24 18:42:56 -08:00
Pierre-Yves David
bb7457d4d7 manifest: fix a bug where working copy file 'add' mark was buggy
Because the same dictionary was used to (1) get node from parent and (2) store
annotated version, we could end up with buggy values. For example with a chain
of renames:

  $ hg mv b c
  $ hg mv a b

The value from 'b' would be updated as "<old-a>a", then the value of c would be
updated as "<old-b>a'. With the current dictionary sharing this ends up with:

    '<new-c>' == '<old-a>aa'

This value is double-wrong as we should use '<old-b>' and a single 'a'.

We now use a read-only value for lookup. The 'test-rename.t' test is impacted
because such a chained added file is suddenly detected as such.
2014-11-26 14:54:16 -08:00
anatoly techtonik
6abd5e7bc0 merge: be precise about what merged into what in short desc 2014-11-26 17:22:09 +03:00
FUJIWARA Katsunori
4359f5ec2d largefiles: avoid exec-bit examination on the platform being unaware of it
Changeset 5b64e22ecd8e introduced the examination of exec bit of
largefiles in "hg status --rev REV" case, but it doesn't avoid it on
the platform being unaware of exec-bit (e.g. on NTFS of Windows).
2014-11-25 18:37:28 +09:00
Durham Goode
0a7a4a1f33 changegroup: fix file linkrevs during reorders (issue4462)
Previously, if reorder was true during the creation of a changegroup bundle,
it was possible that the manifest and filelogs would be reordered such that the
resulting bundle filelog had a linkrev that pointed to a commit that was not
the earliest instance of the filelog revision. For example:

With commits:

0<-1<---3<-4
  \       /
   --2<---

if 2 and 3 added the same version of a file, if the manifests of 2 and 3 have
their order reversed, but the changelog did not, it could produce a filelog with
linkrevs 0<-3 instead of 0<-2, which meant if commit 3 was stripped, it would
delete that file data from the repository and commit 2 would be corrupt (as
would any future pulls that tried to build upon that version of the file).

The fix is to make the linkrev fixup smarter. Previously it considered the first
manifest that added a file to be the first commit that added that file, which is
not true. Now, for every file revision we add to the bundle we make sure we
attach it to the earliest applicable linkrev.
2014-11-20 16:30:57 -08:00
Anton Shestakov
89f6661e0b templates: fix broken "less" & "more" links in paper style (issue4460)
"/search", which is an invalid command in hgweb, was mistakenly used for
"[show] more [revsets]" and "[show] less [revsets]" links on search page in
templates "paper" (and those which inherit paper, such as coal) before and
worked fine until 73c8d0c02c22, which made hgweb more strict about invalid
commands.
2014-11-21 13:58:49 +08:00
Pierre-Yves David
e6c651e56b push: stop independent usage of bundle2 in syncphase (issue4454)
The phase-syncing code was using bundle2 if the remote supported it. It was
doing so without regard to bundle2 activation on the client. Moreover, the
phase push is now properly included in the unified bundle2 push, so having extra
code in syncphase should be useless. If the remote is bundle2-enabled, the
phases should already be synced.

The buggy verification code was leading to a crash when a 3.2 client was pushing
to a 3.1 server. The real bundle2 path detected that their versions were
incompatible, but the syncphase code failed to, sending an incompatible bundle2
to the server.

We drop the useless and buggy code as a result. The "else" clause is
de-indented in the process.
2014-11-19 01:36:17 +00:00
Mads Kiilerich
3337547e58 mq: when adding headers in plain mode, separate them from message (issue4453)
05acc6157816 did a clean-up in one direction ... but we want it in the other
direction.
2014-11-17 01:48:43 +01:00
Mads Kiilerich
dcb2a1808d mq: introduce insertplainheader - same naive implementation as before 2014-11-17 01:48:19 +01:00
Mads Kiilerich
d2e99f9304 mq: when setting message in plain mode, separate it from header (issue4453)
Fix inconsistent handling of plain header separation in mq patcheader - and
contrary to 05acc6157816, do it in the direction of having an empty line
between header and description. Plain patches are like mails and should thus
have an empty line between headers and body in compliance with RFC 822 3.1.
2014-11-16 19:57:40 +01:00
Gregory Szorc
ca2488737b docker: add Docker files for running an Apache mod_wsgi server
I frequently find myself wanting to run hgweb in a production-like
environment, with a real HTTP server and multiple WSGI workers.

This patch introduces a Docker environment for running Mercurial
under Apache + mod_wsgi. With just a few command executions, it is
possible to spin up a Docker container running hgweb.

The container is tailored for Mercurial developers wanting to run
Mercurial from a source checkout. It is **not** meant to be something
suitable for production use.

The container provides a default hgweb environment with an empty
repository that allows pushes. You can thus start a container and push
your favorite repository there for quick testing.

The container is designed to allow customizations. Users can provide
their own hgweb configurations and mount existing directories containing
repositories into the container.

The behavior of the container and how to control things is documented in
the README.rst file.
2014-11-11 20:32:10 -08:00
Martin von Zweigbergk
bdbe0fa90a merge: use None as filename for base in 'both created' conflicts
Instead of using a file that we know is not in the common ancestor's
maniffest, let's use None. This is safe as the only place that cares
about the value (applyupdates) already checks if the item exists in
the ancestor.
2014-11-24 16:17:02 -08:00
Martin von Zweigbergk
96d97f796c merge: break out "both renamed a -> b" case
We can further limit the scope of the 2-way merge case by breaking out
the case where the file was not created from scratch on both sides but
rather renamed in the same way (and is therefore a 3-way merge). This
involves copying some code, but it makes it clearer which case the
"Note:" in the code refers to.
2014-11-24 16:42:36 -08:00
Martin von Zweigbergk
dd435d36bb merge: separate out "both created" cases
When 'f' is not in 'ma', 'a' will be 'nullid' and all the if/elif
conditions that check whether some one nodeid is equal to 'a' will
fail, and the else-clause will instead apply. We can make that more
explicit by creating a separate 'm' action for the case where 'a' is
'nullid'. While it does mean copying some code, perhaps it makes it a
little clearer which codepaths are possible, and which cases the
"Note:" in the code refers to. It also lets us make the debug action
messages a little more specific.
2014-11-24 16:16:34 -08:00
Martin von Zweigbergk
b78125e6ba merge: indent to prepare for next patch 2014-11-24 16:11:22 -08:00
Matt Mackall
e73fb86802 merge with stable 2014-11-25 17:30:05 -06:00
David Eckhardt
7718d2191b factotum: convert Plan 9 quoted string to Python string 2014-11-25 02:31:52 -06:00
Jeff Sickel
5a403fa38d plan9: setup check for current python build 2014-11-25 02:27:31 -06:00
Matt Harbison
6b20f5bf8e add: check for the existence of a file matched inexactly before adding it
The change in 02ecc94fb657 created a problem on Windows and OS X:

    --- /usr/local/mercurial/tests/test-issue660.t
    +++ /usr/local/mercurial/tests/test-issue660.t.err
    @@ -47,6 +47,8 @@
     Should succeed - shadow removed:

       $ hg add b
    +  adding b/b
    +  b/b does not exist!

Prior to the failing 'hg add', the file 'b/b' was added and committed, then 'b'
was recursively deleted from the filesystem, file 'b' was created and the delete
was recorded with 'hg rm --after'.  This add is attempting to record the
existence of file 'b'.

A filesystem that is not case sensitive prevents dirstate.walk() from skipping
its step 3, and step 3 has the effect of inserting removed files into the walk
list.  The Linux code doesn't run through step 3, and didn't exhibit the
problem.  It's not clear why a non case sensitive filesystem triggers step 3,
given that the path normalization occurs in step 2.

Prior to 02ecc94fb657, part of the check here was 'f not in repo.dirstate'
instead of 'f not in wctx'.  Files in the 'r' state are filtered out of
context.__contains__() but not dirstate.__contains__().  Therefore the removed
file name wasn't added to the list of files to add when checking against
dirstate.  That change was to allow removed files to be readded, but adding a
file that doesn't exist is nonsensical.  If the user specifies a missing file,
it will be an exact match and will still fail.
2014-11-19 22:27:55 -05:00
Matt Harbison
299f5087fd tests: choose the proper environment variable style for the platform
Windows was printing out 'commit $HG_NODE' instead of the actual hash.
2014-11-20 22:33:40 -05:00
Matt Harbison
b2eb2ec474 tests: fix another multi-statement hook for Windows
The double quotes are necessary, otherwise it tries to pipe into a program named
'short'.  An '&' could serve as a command separator on Windows instead of ';',
but I don't see any obvious way to swap these depending on the platform.  In
this case though, there really wasn't a need for multiple statements.
2014-11-20 20:07:34 -05:00
Matt Harbison
889536b207 run-tests: set a default largefiles usercache in the default hgrc file
This fixes a test failure introduced in 131ac757f996 on Windows and OS X, where
the cached largefile wasn't being deleted because the named .cache directory
didn't exist.  It only existed on Linux because the test suite sets $HOME to the
directory of the test being run, and Linux uses $HOME/.cache by default.

Most of the other largefiles tests explicitly set this value at the top of their
scripts, but test-largefiles-update.t didn't pick that up when it was created.
Those scripts that do set a value will override this.

We could just set the parameter in the test-largefiles-update.t script, but
there are a few other non obvious tests that exercise largefiles too.  These
largefiles end up being cached in the user's real cache, so proper hygiene
dictates that this not be left to each individual test script.
2014-11-19 23:41:40 -05:00
Martin von Zweigbergk
663d394fe9 merge: remove obsolete check for untracked files in 'dm' action
Since 4a56fba99974 (merge: don't use unknown(), 2012-02-09), untracked
files are no longer included in the manifest diff, so there is no need
to check exclude them when renaming files for directory moves with the
'dm' action.
2014-11-24 09:50:27 -08:00
Martin von Zweigbergk
52b3a1afd7 merge: remove dead assignment in applyupdates() 2014-11-23 23:10:34 -08:00
Martin von Zweigbergk
3e76cdec1c merge: move calculateupdates() before applyupdated()
calculateupdates() happens before applyupdates(), so move it before in
the code. That also moves it close to manifestmerge(), which is a good
location as calculateupdates() is the only caller of manifestmerge().
2014-11-21 13:06:04 -08:00
Martin von Zweigbergk
527ed28755 merge: remove unused variables from _checkcollision() 2014-11-24 11:28:46 -08:00