Commit Graph

20208 Commits

Author SHA1 Message Date
Pierre-Yves David
49ce770140 merge: infer the "other" changeset when falling back to v1 format
When we have to fallback to the old version of the file, we infer the
"other" from current working directory parent. The same way it is currently done
in the resolve command. This is know to have shortcoming… but we cannot do
better from the data contained in the old file format. This is actually the
motivation to add this new file format.
2014-02-27 14:14:57 -08:00
Pierre-Yves David
15afb2ca0c merge: record the "other" node in merge state
We need to record the merge we were merging with. This solve multiple
bug with resolve when dropping the second parent after a merge. This
happen a lot when doing special merge (overriding the ancestor).
Backout, shelve, rebase, etc. can takes advantage of it.

This changeset just add the information in the merge state. We'll use it in the
resolve process in a later changeset.
2014-02-25 18:42:11 -08:00
Pierre-Yves David
b5e943e8cb merge: introduce new format for the state file
This new format will allow us to address common bugs while doing special merge
(graft, backout, rebase…) and record user choice during conflict resolution.

The format is open so we can add more record for future usage.

This file still store hexified version of node to help human willing to debug
it by hand. The overhead or oversize are not expected be an issue.

The old format is still used. It will be written to disk along side the newer
format. And at parse time we detect if the data from old version of the
mergestate are different from the one in the new version file. If its the same,
both have most likely be written at the same time and you can trust the extra
data from the new file. If it differs, the old file have been written by an
older version of mercurial that did not knew about the new file. In that case we
use the content of the old file.
2014-02-25 18:37:06 -08:00
Pierre-Yves David
01a482bed9 merge: change the merge state serialisation to use a record based logic
The format of the file is unchanged. But we are preparing a new file with a new
format that would be record based. So we change all the read/write logic to
handle a list of record until a very low level. This will allow simple plugging
of the new format in the current code.
2014-02-27 12:59:41 -08:00
Pierre-Yves David
2438827558 merge: move merge state file path into a constant
We are about to change the format. Having the file path in a single place make
it easier to update the filename for the new version.
2014-02-25 17:14:49 -08:00
anuraggoel
d215557c0e coal: hgweb style adds extra blank line in file view (issue4136)
Now hgweb style='coal' adds no extra blank in file view.
2014-02-27 22:56:42 +05:30
Piotr Klecha
0968676adc pull: close peer repo on completion (issue2491) (issue2797)
When pulling changes from a compressed bundle Mercurial first uncompresses it
to a temporary file in .hg directory. This file will not be deleted unless
the bundlerepo (other) is explicitly closed.

This is similar to cleanup that occurs after incoming.
2014-02-25 21:26:25 +01:00
Paul Boddie
202d2d5cf4 hgweb: ensure isdirectory is None for repositories, replacing any True value
Until now, repositories did not provide any value for isdirectory in rows
produced for the index output, and thus isdirectory was generally evaluated as
None for each index entry representing a repository.

However, directories (visible when viewed with the descend and collapse
settings enabled) did provide a value of True and this value appeared to
persist in subsequent rows processed by the templater, causing isdirectory
tests in templates to produce incorrect results for index entries appearing
after directories.

This patch asserts the None value for repositories, thus erasing any such
persistent True values.
2014-02-27 00:24:06 +01:00
anuraggoel
08543b09f1 purge: avoid duplicate output for --print (issue4092)
Now "hg purge -p" commands avoids printiing duplication of filenames.

Second patch is the test coverage of first patch which tells that '-p'
does not depend on whether ui.verbose is configured or not,that means it
is independent of '-v'.
2014-02-25 06:30:21 +05:30
Matt Mackall
8bd1eb5dcb merge with i18n 2014-02-24 18:48:48 -06:00
FUJIWARA Katsunori
ca6fba30d7 i18n-ja: synchronized with ab338a276a26 2014-02-23 18:03:47 +09:00
Danek Duvall
7e62057404 pathencode: eliminate signed integer warnings
Compiling mercurial with the Sun Studio compiler gives seven copies of the
following warning on pathencode.c:

    line 533: warning: initializer will be sign-extended: -1

Using explicit unsigned literals silences it.
2014-02-19 13:11:24 -08:00
Yuya Nishihara
6852c0bb11 verify: do not prevent verify repository containing hidden changesets
Since afe2bc876c89, repo.cancopy() cannot be used to check if the repo is
a bundlerepository.

repo.url() should always have "scheme:", so it isn't necessary to parse
by util.url().
2014-02-19 22:19:45 +09:00
Yuya Nishihara
cdb5aade4f hgweb: make sure sys module is loaded prior to reload hack
If sys is still a demandmod, reload(sys) fails with "TypeError: reload()
argument must be module".
2014-02-19 21:16:43 +09:00
Wagner Bruna
b0248dcfdb i18n-pt_BR: synchronized with 78794a4dc37f 2014-02-16 09:04:49 -03:00
Yuya Nishihara
c857975766 rebase: do not try to reactivate deleted divergent bookmark
If the currently active bookmark is divergent one, it may be resolved during
rebase.  Trying to activate it will raise "KeyError: 'W@diverge'".
2014-02-15 16:19:19 +09:00
Thomas Arendsen Hein
a22586ff6f help: new SHA-1 fingerprint of hg.intevation.org in hostfingerprints example
The certificate was updated in February 2014.
You can verify the certificate by using the Root CA certificate downloadable
from https://ssl.intevation.de/
The intermediate CA is sent by https://hg.intevation.org/
2014-02-13 13:05:09 +01:00
Brodie Rao
fc55ccd1ef hooks: only disable/re-enable demandimport when it's already enabled
This fixes an issue introduced in 818c8992811a where, when disabling
demandimport while running hooks, it's inadvertently re-enabled even when
it was never enabled in the first place.

This doesn't affect normal command line usage of Mercurial; it only matters
when Mercurial is run with demandimport intentionally disabled.
2014-02-10 14:51:06 -08:00
Mads Kiilerich
4aef593d5a merge: don't overwrite file untracked after remove, abort with 'untracked files'
Merge could overwrite untracked files and cause data loss.

Instead we now handle the 'local side removed file and has untracked file
instead' case as the 'other side added file that local has untracked' case:

  FILE: untracked file exists
  abort: untracked files in working directory differ from files in requested revision

It could perhaps make sense to create .orig files when overwriting, either
instead of aborting or when overwriting anyway because of force ... but for now
we stay consistent with similar cases.
2014-02-10 00:43:54 +01:00
Matt Mackall
fd6c6f9614 hgweb: hack around mimetypes encoding thinko (issue4160)
A correct patch for this has existed in Python's BTS for 3 years
(http://bugs.python.org/issue9291), so waiting for it to be fixed
upstream is probably not a viable strategy. Instead, we add this
horrible hack to workaround the issue in existing copies of Python
2.4-2.7.
2014-02-05 17:23:35 -06:00
Siddharth Agarwal
228773d706 hg: note that islocal only accepts paths pointing to repos
hg.islocal doesn't work for paths pointing to non-repos, such as patch files.
2014-02-03 14:36:20 -08:00
Siddharth Agarwal
cfe3861321 hg.openpath: use url.islocal to tell if the path is local (issue3624)
Previously we used hg.islocal, which doesn't work for paths pointing to
non-repos, such as patch files.
2014-02-03 14:53:44 -08:00
Siddharth Agarwal
22a22b291a util.url: add an 'islocal' method
This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
2014-02-03 14:47:41 -08:00
Matt Mackall
4a9059c01f Added signature for changeset 235171a1c71c 2014-02-01 15:20:49 -06:00
Matt Mackall
681a024aa8 merge with i18n 2014-02-01 14:53:52 -06:00
Pierre-Yves David
b563457396 rebase: do not crash in panic when cwd disapear in the process (issue4121)
Before this patch rebase crashed badly when it happend. (not abort, crash).

Fix courtesy of Matt Mackall.
2014-01-31 15:13:15 -08:00
Pierre-Yves David
0d013e32a2 record: use absolute path instead of os.chdir
Record was changing the current directory to `repo.root` in order to be able to
feed `command.commit` file name relative to this `repo.root`. This is a bit
overkill and prevent an incoming fix to rebase. This would also break
multi-threaded usage.

Instead we just feed `command.commit` with absolute path name. works as well as
before but without chdir.
2014-01-31 14:52:53 -08:00
Wagner Bruna
7d02010045 i18n-pt_BR: synchronized with 14badd276955 2014-01-31 15:25:31 -02:00
FUJIWARA Katsunori
1faeeaaaaa i18n-ja: change translation to fix test-gendoc.t failure with old docutils
Before this patch, "ja.po" translation causes test-gendoc.t failure
with old docutils: It fails with docutils 0.7, but not with 0.11.
2014-01-31 16:27:26 +09:00
Simon Heimberg
0663ca30c6 i18n-de: update many fuzzy entries and translate some simple ones
I mainly did the simple cases, like removing ".. note::", changing single
quotes to double quotes and adapting underlining.
Unhelpful msgstr in fuzzy entries are removed. (They were suggestions by the
program msgmerge.)
2014-01-30 23:34:18 +01:00
Angel Ezquerra
83f28887f2 help: improve description of phases.checksubrepos setting
The existing description was a bit hard to understand.
2014-01-29 15:16:36 +01:00
Pierre-Yves David
6265090dee clone: do not turn hidden changeset public on publishing clone (issue3935)
Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.
2014-01-30 11:52:38 -08:00
lstewart
7eb5e89201 convert: use branchmap to change default branch in destination (issue3469)
The fix for issue2653 broke the ability to map the default branch of a source
repository to a non-default named branch in the destination repository.  Leave
the default behaviour as is, but allow the branch name "None" to be used to map
to a non-default named branch in the destination repository.
2014-01-28 14:00:23 +11:00
Julien Cristau
e78105c48a dispatch: take --hidden from individual commands into account
The command server would otherwise ignore that option, since the repo
object is only created once.
2014-01-27 10:57:20 +01:00
FUJIWARA Katsunori
870ab22a06 doc: fix mistake about matching against directories in "pattern.txt"
This fixes mistake of documentation about matching against directories
in "pattern.txt" introduced by b99923dc748f.

".hgignore" treats specified "glob:" pattern as same as one specified
for "-X" option: it can match against directories, too.

For reference, extra regexp string appended to specified pattern for
each types are listed below: see also "match.match()" and
"match._regex()" for detail.

  ============= ========== ===============
  type          cmdline    -I/-X
  ============= ========== ===============
  glob/relglob  '$'        '(?:/|$)'
  path/relpath  '(?:/|$)'  '(?:/|$)'
  re/relre      (none)     (none)
  ============= ========== ===============

Appending '$' means that the specified pattern should match against
only files.
2014-01-30 15:03:36 +09:00
FUJIWARA Katsunori
0b98e91e90 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
Before this patch, shell alias may be executed by abbreviated command
name unexpectedly, even if abbreviated command name matches also
against the command provided by extension.

For example, "rebate" shell alias is executed by "hg reba", even if
rebase extension (= "rebase" command) is enabled. In this case, "hg
reba" should be aborted because of command name ambiguity.

This patch makes "_checkshellalias()" invoke "cmdutil.findcmd()"
always with "strict=True" (default value).

If abbreviated command name matches against only one shell alias even
after loading extensions, such shell alias will be executed via
"_parse()".

This patch doesn't remove "_checkshellalias()" invocation itself,
because it may prevent shell alias from loading extensions uselessly.
2014-01-29 23:47:54 +09:00
Matt Mackall
c738b36ce1 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155) 2014-01-30 13:56:56 -06:00
FUJIWARA Katsunori
26f147d151 i18n-ja: change phrasing for "or" 2014-01-30 17:09:13 +09:00
FUJIWARA Katsunori
14b2d2b8ec i18n-ja: fix some quoting problems for space character usage 2014-01-29 22:14:41 +09:00
FUJIWARA Katsunori
6441520dfe i18n-ja: synchronized with 3ff21233db0b 2014-01-29 21:38:10 +09:00
Simon Heimberg
044892facc i18n: fix non-matching 1st line indentations
When generating documentation, indentation must match for getting the same
view for translated messages. Often an output is generated anyway, but it
can look different. When a syntactically wrong indentation change is done,
runrst will fail (this is detected by test-gendoc.t).

Fix the simple places. When translation knowledge is necessary, the entry is
marked as fuzzy (and therefore skipped when generating translations). A
translator can fix it later.
2014-01-22 16:47:05 +01:00
Simon Heimberg
c6c6a2dd92 i18n: fix some non matching quotation marks in translations
A test for this is in preparation.
2014-01-22 16:35:10 +01:00
Simon Heimberg
889e04cd3a i18n: do not translate rst syntax .. note::
.. note:: is rst syntax which must not be translated. Fix this in the
translations.

This is not the first time this happens, so there should be a note for the
translator. A later patch will change the generation of the po files to
write this automatically.
A test in i18n/check-translation.py could help as well.
2014-01-22 16:34:36 +01:00
Leonardo Bueno Postacchini
b270594f22 i18n-pt_BR: synchronized with f908b17c97cc 2014-01-27 16:34:00 -02:00
Simon Heimberg
77e680884d i18n-de: updated po file with 3d9f67cfdcaf
Do this in a separate patch for easier reviewing of the translation patch.
2014-01-22 16:32:53 +01:00
Simon Heimberg
0c637f44ed i18n-de: remove locations
Strip the locations by running msgcat [1] as the wiki [2] tells to do. Do
this in a separate patch for getting a smaller one when updating from hg.pot.

[1] msgcat --no-location -o de.po de.po
[2] mercurial.selenic.com/wiki/TranslatingMercurial#Updating_a_Translation
2014-01-22 16:32:52 +01:00
Angel Ezquerra
9d9e80e852 subrepo: make it possible to update to hidden subrepo revisions
When a subrepo revision was hidden it was considered missing and mercurial was
unable to update to the corresponding parent revision. Instead warn the user of
the problem and let it choose what to do (the default is to udpate anyway).
2013-11-24 02:17:17 +01:00
Angel Ezquerra
c5703b123e subrepo: remove unnecessary else clause in hgsubrepo._get
This revision has no behaviour change. It simply removes an unnecessary else
that follows an if / return block. The change looks big because a big chunk of
code has been unindented one level.
2013-11-24 02:13:00 +01:00
Angel Ezquerra
6a8a8a8e21 subrepo: do not try to get hidden revisions
If a subrepo revision is hidden (because it was amended, for example) it does
not make sense to try to "get" it from the remote subrepository.

Note that in order to avoid making the change look bigger than it is, this adds
an unnecessary else clause. This will be removed on a follow up patch.
2013-11-24 02:10:14 +01:00
David Soria Parra
e5be8c59d8 parsers: fix 'unsigned expression is always true' warning (issue4142)
On Mac OS gcc-llvm throws an -Wtautological-compare warning because flen
is defined as an unsigned integer, therefore flen < 0 is always true.
2014-01-23 19:08:26 +01:00