Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 31 Aug 2014 13:01:00 +0200] rev 22611
revert: properly back up added files with local modification
These files were previously not backed up because the backup mechanism was not
smart enough. This leads to data lose for the user since uncommitted contents
were discarded.
We now properly move the modified version to <filename>.orig before deleting it.
We have to use a small hack to do a different action if "--no-backup" is
specified. This is needed because the backup process is actually a move (not a
copy) so the file is already missing when we backup. The internet kitten is a
bit disapointed about that, but such is life.
This patch concludes the "lets refactor revert" phases. We can now open the
"Lets find stupid bug with renames and merge" phases.
I'm sure that now that the code is clearer we could do it in another simpler
way, but I consider the current improvement good enough for now.
Pierre-Yves David <pierre-yves.david@fb.com> [Sat, 30 Aug 2014 02:39:08 +0200] rev 22610
revert: track added files with local modifications
Those files need to be backed up but are currently not. We compute the set of
them to be able to use a different backup strategy in the next changeset.
Pierre-Yves David <pierre-yves.david@fb.com> [Sat, 30 Aug 2014 02:30:24 +0200] rev 22609
revert: distinguish between "check" and "backup" strategy
"check" behaves as backup did before. We check if the current file differs
from destination and we create a backup if it does. This is used for untracked
files that will be overwritten by formerly-deleted files. We have to do the manual
check since no status output can provide the content comparison.
"backup" is now doing unconditional backup. This can be used for files seen as
modified compared to both the target and the working directory. In such a case, we
know that the file differs from target without actually comparing any content.
This new "backup" strategy will be especially useful in the case of files added
between the target and the working directory -parent- with additional modifications
in the working directory -itself-. In that case we know we need to back it up, but we
cannot run the content check as the files does not exists in target.
Pierre-Yves David <pierre-yves.david@fb.com> [Sat, 30 Aug 2014 02:28:27 +0200] rev 22608
revert: small refactoring in the way backup value are handled
The current backup value may have two different values:
1. Do not try to do backup
2. Do backup if applicable
We are about to move to:
1. Do not try to do backup
2. Do backup if applicable
3. Do backup in all cases
So we change the current values to make room for the new one.
Matt Mackall <mpm@selenic.com> [Wed, 01 Oct 2014 15:05:09 -0500] rev 22607
merge with stable
Matt Mackall <mpm@selenic.com> [Wed, 01 Oct 2014 14:59:33 -0500] rev 22606
Added signature for changeset
f768c888aaa6
Matt Mackall <mpm@selenic.com> [Wed, 01 Oct 2014 14:58:05 -0500] rev 22605
Added tag 3.1.2 for changeset
f768c888aaa6
Matt Mackall <mpm@selenic.com> [Wed, 01 Oct 2014 14:44:24 -0500] rev 22604
parsers: fix Py2.4 argument parsing issue
Since
fa53d66b45a8, we were getting this strange message with Py2.4:
TypeError: argument 1 must be impossible<bad format char>, not int
..because we were using the 'n' type specifier introduced in 2.5.
It turns out that offset is actually a revision number index, which
ought to be an int anyway. So we store it in an int, use the 'i'
specifier, rely on Py_ParseTuple for range checking, and rename it to
avoid type confusion.
Matt Mackall <mpm@selenic.com> [Wed, 01 Oct 2014 12:35:18 -0500] rev 22603
merge with i18n
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 30 Sep 2014 16:59:07 -0400] rev 22602
diff: document the nobinary option
Since
3fbef7ac26f0, we have a diff.nobinary option. This is handy, but
the only way I found out about it was by looking at the release notes
for 3.1, which is not something I normally do.
Wagner Bruna <wbruna@softwareexpress.com.br> [Tue, 30 Sep 2014 13:43:30 -0300] rev 22601
i18n-pt_BR: minor fixes and rewording on histedit help text
Wagner Bruna <wbruna@softwareexpress.com.br> [Tue, 30 Sep 2014 10:17:59 -0300] rev 22600
i18n-pt_BR: synchronized with
c712238c4f9b
Wagner Bruna <wbruna@softwareexpress.com.br> [Tue, 30 Sep 2014 10:13:25 -0300] rev 22599
merge with i18n
Wagner Bruna <wbruna@softwareexpress.com.br> [Mon, 22 Sep 2014 15:39:21 -0300] rev 22598
i18n-pt_BR: synchronized with
802dffd62de5
Mike Edgar <adgar@google.com> [Sun, 14 Sep 2014 20:32:34 -0400] rev 22597
filelog: censored files compare against empty data, have 0 size
To support "status" operations against working directories that are
the children of censored revisions, filelog must define "cmp" and "size"
for censored content.
Mike Edgar <adgar@google.com> [Wed, 03 Sep 2014 22:14:20 -0400] rev 22596
filelog: raise CensoredNodeError when hash checks fail with censor metadata
With this change, when a revlog revision hash does not match its content, and
the content is empty with a special metadata key, the integrity failure is
assumed to be intentionally caused to remove sensitive content from repository
history.
To allow different Mercurial functionality to handle this scenario differently
a more specific exception is raised than "ordinary" hash failures.
Alternatives to this approach include, but are not limited to:
- Calling a hook when hashes mismatch to allow arbitrary tombstone validation.
Cons: Irresponsibly easy to disable integrity checking altogether.
- Returning empty revision data eagerly instead of raising, masking the error.
Cons: Push/pull won't roundtrip the tombstone, so client repos are unusable.
- Doing nothing differently at this layer. Callers must do their own detection
of tombstoned data if they want to handle some hash checks and not others.
- Impacts dozens of callsites, many of which don't have the revision data
- Would probably be missing one or two callsites at any given time
- Currently we throw a RevlogError, as do 12 other places in revlog.py.
Callers would need to parse the exception message and/or ensure
RevlogError is not thrown from any other part of their call tree.
Mike Edgar <adgar@google.com> [Wed, 03 Sep 2014 15:59:03 -0400] rev 22595
error: add CensoredNodeError, will be thrown when content deliberately erased
This change introduces the error plus a corresponding catch in dispatch, to
provide localized error messages.
The verb "censor" is used in this commit and all following to refer to erasing
the content of a revlog revision (filelog, for now) without recalculating node
IDs, leaving that revision invalid. Further work must be done to safely share
such revision data with compliant clients.
I find the analogy to censorship straightforward; for less politically
charged options, consider "erase", "excise", "expunge", or "blackhole".
Siddharth Agarwal <sid0@fb.com> [Tue, 30 Sep 2014 16:01:19 -0700] rev 22594
files: cache repo.dirstate
For a large repo, 'hg files' goes from 2.27 seconds to 1.92.
Siddharth Agarwal <sid0@fb.com> [Tue, 30 Sep 2014 15:21:35 -0700] rev 22593
files: only check for removed, not unknown or missing
ctx.matches() doesn't return unknown files, and repo.dirstate[f] never returns
'!' for an answer.
Siddharth Agarwal <sid0@fb.com> [Tue, 30 Sep 2014 14:39:58 -0700] rev 22592
files: use ctx.matches instead of ctx.walk
ctx.matches() is an optimized form of ctx.walk() when we don't care about the
state of files on disk.
For a large repo, 'hg files > /dev/null' drops from 3.7 seconds to 2.3.
Siddharth Agarwal <sid0@fb.com> [Tue, 30 Sep 2014 15:45:48 -0700] rev 22591
files: actually filter out removed files
'hg files' makes an attempt to filter out removed files, but that doesn't work
because repo.dirstate[f] returns lowercase 'r', not uppercase.
Mads Kiilerich <madski@unity3d.com> [Wed, 01 Oct 2014 01:08:17 +0200] rev 22590
subrepo: remove superfluous newline from subrepo prompt
Mads Kiilerich <madski@unity3d.com> [Wed, 01 Oct 2014 01:04:18 +0200] rev 22589
ui: show prompt choice if input is not a tty but is forced to be interactive
The tests often set ui.interactive to control normally interactive prompts from
stdin. That gave an output where it was non-obvious what prompts got which
which response, and the output lacked the newline users would see after input.
Instead, if the input not is a tty, write the selection and a newline.
Matt Mackall <mpm@selenic.com> [Tue, 30 Sep 2014 18:22:58 -0500] rev 22588
merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 30 Sep 2014 16:40:10 -0500] rev 22587
help: basic support for showing only specified topic sections
For instance, 'hg help config.files' will show only the Files section.
Matt Mackall <mpm@selenic.com> [Tue, 30 Sep 2014 15:55:30 -0500] rev 22586
help: use OS containers for config file lists
Matt Mackall <mpm@selenic.com> [Tue, 30 Sep 2014 15:51:22 -0500] rev 22585
help: support OS-specific help sections
Containers of the form:
.. container:: verbose.<os>
are shown by default on the given OS (or with -v).
Matt Mackall <mpm@selenic.com> [Tue, 30 Sep 2014 15:48:43 -0500] rev 22584
minirst: allow multiple container types for prune
If we have a container of type x.y, then we can preserve it by
keeping x or y.
Mads Kiilerich <madski@unity3d.com> [Thu, 04 Sep 2014 21:36:35 +0200] rev 22583
config: don't read the same config file twice
In some cases some config files would be read twice and shown twice in
showconfig --debug.
Yuya Nishihara <yuya@tcha.org> [Tue, 30 Sep 2014 23:15:56 +0900] rev 22582
templater: fix precedence of --style and --template options
Since
e3eb480a9391, --template option is ignored if --style is specified,
which is wrong according to the doc of show_changeset():
Display format will be the first non-empty hit of:
1. option 'template'
2. option 'style'
...
Martin von Zweigbergk <martinvonz@gmail.com> [Mon, 29 Sep 2014 23:23:44 -0700] rev 22581
shelve: avoid writing file that is never read from
The contents of the .files file has not been used since
1d7a36ff2615
(shelve: use rebase instead of merge (
issue4068), 2013-10-23), so stop
writing it. Where we currently use the presence of the file as a check
for a valid shelve name, switch to checking for the .patch file.
Andrew Shadura <andrew@shadura.me> [Sun, 28 Sep 2014 15:21:29 +0200] rev 22580
hgk: don't break on repositories with obsolete changesets
Check the existence of a changeset before adding it to the list
returned by debug-rev-list command.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 18 Sep 2014 11:43:47 -0700] rev 22579
test: protect the run-tests.py --json test behind an hghave rule
We add a rules to detect availability of a json module and skip if json is not
available.
Matt Mackall <mpm@selenic.com> [Mon, 29 Sep 2014 17:23:38 -0500] rev 22578
merge with stable
Anton Shestakov <engored@ya.ru> [Sat, 27 Sep 2014 21:59:55 +0900] rev 22577
hgweb: refresh hgweb.repo on phase change (
issue4061)
Make hgweb.refresh() also look at phaseroots file (in addition to 00changelog.i
file) and reload the repo when os.stat returns different mtime or size than
cached, signifying the file was modified.
This way if user changes phase of a changeset (secret <-> draft), there's no
need to restart hg serve to see the change.
Matt Mackall <mpm@selenic.com> [Mon, 29 Sep 2014 16:42:12 -0500] rev 22576
help: fix typo in log examples
Mads Kiilerich <madski@unity3d.com> [Fri, 26 Sep 2014 02:19:48 +0200] rev 22575
ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs
This will give PKI-secure behaviour out of the box, without any configuration.
Setting web.cacerts to any value or empty will disable this trick.
This dummy cert trick only works on OS X 10.6+, but 10.5 had Python 2.5 which
didn't have certificate validation at all.
Mads Kiilerich <madski@unity3d.com> [Fri, 26 Sep 2014 02:19:47 +0200] rev 22574
ssl: refactor sslkwargs - move things around a bit, preparing for next change
Durham Goode <durham@fb.com> [Fri, 19 Sep 2014 18:43:53 -0700] rev 22573
revert: special case 'hg revert --all'
On large repos, hg revert --all can take over 13 seconds. This is mainly due to
it walking the tree three times: once to find the list of files in the
dirstate, once to find the list of files in the target, and once to compute the
status from the dirstate to the target.
This optimizes the hg revert --all case to only require the final status. This
speeds it up to 1.3 seconds or so (with hgwatchman enabled).
Further optimizations could be done for the -r NODE and pattern cases, but they
are significantly more complex.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 17:21:38 +0900] rev 22572
test-commandserver: make runcommand message bolder
It seems ' runcommand' is difficult to distinguish from command output.
'*** runcommand' is slightly better.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 14:46:57 +0900] rev 22571
test-commandserver: rewrite manual substitution of output by (glob) match
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 16:59:30 +0900] rev 22570
test-commandserver: remove redundant banner output
Since test output was inlined, "testing <func>" message should no longer
be necessary.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 16:55:14 +0900] rev 22569
test-commandserver: remove .py test which was ported to .t
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 16:05:37 +0900] rev 22568
test-commandserver: port test functions from .py to .t
Though we have to duplicate import statements, .t test is still more handy
than .py test which has cryptic .out file.
This change allows to skip a part of test by #if conditional, which my next
patch series depends on.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 14:27:40 +0900] rev 22567
test-commandserver: add stub for .t test by copying .out with 2-space indent
Currently test-commandserver.t only contains output, so it is skipped by
#require false.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 13:31:16 +0900] rev 22566
test-commandserver: split helper functions to new hgclient module
This prepares for porting test-commandserver.py to .t test.
Though command-server test needs many Python codes, .t test will be more
readable than .py test thanks to inlined output.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 15:13:35 +0900] rev 22565
heredoctest: do not append extra newline character to continuation line
Trailing newline characters are kept in lines.
Yuya Nishihara <yuya@tcha.org> [Sun, 28 Sep 2014 14:15:43 +0900] rev 22564
heredoctest: use the same dict for local/global contexts as in doctest
In order to mimic module-level evaluation, globals and locals should be the
same object, so doctest does not pass separate locals dict.
https://docs.python.org/2.7/reference/simple_stmts.html#exec
This fixes NameError in the following example:
>>> import foo
>>> def bar():
... foo # must exist in globalvars
Yuya Nishihara <yuya@tcha.org> [Sat, 27 Sep 2014 12:37:53 +0900] rev 22563
cmdserver: drop useless in_ attribute from channeledoutput
The previous patch makes sure that in_ == out, so it's no longer needed
to keep in_ for __getattr__. Also, it seems strange for channeledoutput
to have in_ stream which is actually a writable file object.
Yuya Nishihara <yuya@tcha.org> [Sat, 27 Sep 2014 12:27:03 +0900] rev 22562
cmdserver: get file attributes of 'e'-channel from stdout, not from stderr
It seems wrong to get attributes from object different than the underlying
file. In the following example, it doesn't make sense to flush stderr after
writing to stdout:
self.ferr.write(str(a))
if not getattr(self.ferr, 'closed', False):
self.ferr.flush()
Yuya Nishihara <yuya@tcha.org> [Sat, 27 Sep 2014 12:15:01 +0900] rev 22561
cmdserver: correct doc of channeledoutput
in_ is only used as the source of file attributes.
Matt Mackall <mpm@selenic.com> [Sat, 27 Sep 2014 14:47:52 -0500] rev 22560
merge with stable
Matt Mackall <mpm@selenic.com> [Fri, 26 Sep 2014 16:44:11 -0500] rev 22559
commands: add debuglocks to report/clear lock state
Siddharth Agarwal <sid0@fb.com> [Wed, 24 Sep 2014 11:20:35 -0700] rev 22558
test-convert-git.t: make copy detection deterministic
Since both 'bar' and 'bar-copied' matched 'bar-copied2', Git's copy detection
would sometimes result in 'bar' being the source for 'bar-copied2' and
sometimes 'bar-copied'. Change bar in a separate commit so that that would no
longer be the case.
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 23 Sep 2014 17:12:27 -0700] rev 22557
revsetbenchmark: add a rebase-related revset to the benchmark list
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 23 Sep 2014 17:09:19 -0700] rev 22556
revsetbenchmark: allow comments ('#' prefix) in the revset input
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 23 Sep 2014 17:08:49 -0700] rev 22555
revsetbenchmark: make it clear that revsets may be read from stdin
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Sep 2014 12:50:48 +0900] rev 22554
tags: use full hash for formatter output as in log or annotate commands
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Sep 2014 12:46:23 +0900] rev 22553
tags: change field name of formatter output to be the same as log command
Since -T option is not public yet, this won't break backward compatibility.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Sep 2014 12:38:47 +0900] rev 22552
files: correct topic of formatter