Commit Graph

24014 Commits

Author SHA1 Message Date
Matt Mackall
37e98d0538 check-code: allow disabling msys path check 2015-03-05 13:21:57 -06:00
Yuya Nishihara
3adf9bf0f3 revset: extend fullreposet to make "null" revision magically appears in set
As per fullreposet.__and__, it can omit the range check of rev.  Therefore,
"null" revision is accepted automagically.

It seems this can fix many query results involving null symbol.  Originally,
the simplest "(null)" query did fail if there were hidden revisions.  Tests
are randomly chosen.

fullreposet mimics the behavior of localrepo, where "null" revision is not
listed but contained.
2015-01-08 23:05:45 +09:00
Yuya Nishihara
f6f2cc07d6 revset: duplicate spanset.__contains__ to fullreposet for modification
fcccbf073394 says we should avoid function calls in __contains__, so
super(fullreposet, self).__contains__(rev) is not an option.

Actually the super call doubled the benchmark result of trivial query:

revisions:
0) 6aa81b0c4658 (tip when I wrote this patch)
1) rev == node.nullrev or super(fullreposet, self).__contains__(rev)

revset #0: tip:0
0) wall 0.008441 comb 0.010000 user 0.010000 sys 0.000000 (best of 282)
1) wall 0.016152 comb 0.010000 user 0.010000 sys 0.000000 (best of 146)
2015-01-10 18:09:25 +09:00
Yuya Nishihara
ee4ca20b38 revset: have all() filter out null revision
I'm not sure if "all()" should filter out "null", but "all()" is stated as
'the same as "0:tip"' (except that it doesn't reorder the subset, I think.)

This patch is intended to avoid exposing a fullreposet to graphmod.dagwalker(),
which would result in strange drawing in future version:

  |
  o  changeset:   0:f8035bb17114
  |  user:        test
  |  date:        Thu Jan 01 00:00:00 1970 +0000
  |  summary:     add a

caused by:

    parents = sorted(set([p.rev() for p in ctx.parents()
                          if p.rev() in revs]))

We cannot add "and p.rev() != nullrev" here because revs may actually include
"null" revision.
2015-01-10 14:49:50 +09:00
Yuya Nishihara
bc28702606 revset: drop unnecessary calls of getall() with empty argument
If x is None, getall(repo, subset, x) == subset.
2015-01-10 16:41:36 +09:00
Yuya Nishihara
74fe7e4a0f graphlog: do not bypass commands.log so that -fr works
Since 1c6485ced49b, opts dict can be modified in commands.log() before calling
cmdutil.graphlog().
2015-03-04 21:47:07 +09:00
Mateusz Kwapich
0ddde4bfd1 histedit: add a config allowing changing histedit rule line length limit
Since many users are using terminals wider than 80 chars there should be an
option to have longer lines in histedit editor.

Even if the summary line is shorter than 80 chars after adding action line
prefixes (like "pick 7c2fd3b9020c") it doesn't fit there anymore. Setting
it to for example 110 would be a  nice option to have.
2015-01-21 14:45:24 -08:00
Matt Mackall
94d4298620 histedit: fix style of new error message
- lowercase
- no punctuation
- brief
- short node
2015-03-03 17:28:05 -06:00
Augie Fackler
d5c405b03d Makefile: allow setting HGTESTFLAGS in shell environment for TESTFLAGS
I keep wanting to run 'make tests', but I forget to set TESTFLAGS='-j
16' or whatever is reasonable for my machine. This lets me just set it
once in my shell settings and forget it.
2015-02-04 15:17:13 -05:00
Augie Fackler
bc6c2de805 Makefile: introduce testpy-% target for testing with a specifc Python
This makes it easy to do 'make testpy-2.4.6 TESTFLAGS="-j 16"' and the
Makefile will build Python if needed and then run tests (with -j 16)
with the resulting Python.

You can set the environment variable HGPYTHONS to a nice location on
your machine to cache the Python builds globally. If that's not set,
it builds them inside build/pythons.
2015-02-04 12:26:16 -05:00
Jordi Gutiérrez Hermoso
3fea7e90e6 extdiff: expand tildes and variables in paths to user-supplied diff programs 2015-02-27 17:35:07 -05:00
Joan Massich
b9e096fd36 setup.py: do not install c extensions on pypy
These extensions are slower on pypy because pypy has a JIT compiler.
And also, they often do not compile (it depends on the pypy configuration).
2015-02-22 15:40:36 +01:00
Jesus Cea
60d6ae885a copyright: update to 2015
Many files and translations have an outdated copyright date.
Change that to the correct "2005-2015" dates.
2015-03-02 14:52:04 +01:00
Mike Edgar
b4a5dfbe4d changegroup: emit full-replacement deltas if either revision is censored
To ensure that exchanged deltas in the presence of censored revisions can
always be applied to the recipient repository, the deltas must replace the
entire base text. To make this restriction reasonably enforceable, the delta
must do so with a single patch operation.

For background and broader design of the censorship feature, see:
http://mercurial.selenic.com/wiki/CensorPlan
2015-01-21 22:09:32 -05:00
Durham Goode
0744c2b71c log: make -fr show complete history from the given revs
Right now it's very obtuse to show the history of a particular rev (hg log -r
'reverse(::foo)'). This changes the -f option to make it follow history for the
revs specified by -r.

The current -f -r behavior is to limit the result of -r to only the
commits that are ancestors of the current working copy. Changing this
is a bit of a BC break, but the old behavior is A) rare, B) easy to
emulate (& ::.), and C) currently undefined. The new behavior is
frequently requested enough that I think the change is worth it.
2015-02-06 11:04:55 -08:00
André Klitzing
350700ad60 util: accept "now, today, yesterday" for dates even the locale is not english
Hi there!

Fixed date names are helpful for automated systems. So it is possible to
use english date parameter even if the underlying system uses another
locale.

We have here a jenkins with build jobs on different slaves that will do
some operations with "dates" parameter. Some systems uses English locale
and some systems uses German locale. So we needed to configure the job to
uses other date names.

As this is really annoying to keep the systems locale in mind for some
operations I looked into util.py. It would be helpful for automated systems
if the "default English" date names would even usable on other
locales.

I attached a simple patch for this.

Best regards
  André Klitzing
2015-02-24 14:12:13 +01:00
Martin von Zweigbergk
2de043381d copies: only calculate 'addedinm[12]' sets once
Pass the addedinm1 and addedinm2 instead of m1, m2, ma into
_computenonoverlap() instead of calculating the sets twice.
2015-02-27 14:26:22 -08:00
Martin von Zweigbergk
d4eabc6ccd copies: calculate 'bothnew' from manifestdict.filesnotin()
In the same spirit as the previous change, let's now calculate the
'bothnew' variable using manifestdict.filesnotin().5D
2015-02-27 14:03:01 -08:00
Martin von Zweigbergk
93f839cfd2 copies: replace _nonoverlap() by calls to manifestdict.filesnotin()
Now that we have manifestdict.filesnotin(), we can write _nonoverlap()
in terms of that method instead, enabling future speedups when
filesnotin() gets optimized, and perhaps making the code a little
clearer at the same time.
2015-02-27 14:02:30 -08:00
Martin von Zweigbergk
199e845f93 copies: move code into new manifestdict.filesnotin() method
copies._computeforwardmissing() finds files in one context that is not
in the other. Let's move this code into a new method on manifestdict,
so m1.filesnotin(m2) can be optimized for various types of manifests
(we expect more types of manifests soon).
2015-02-27 13:57:37 -08:00
Matt Harbison
53cb50db7b subrepo: warn when adding already tracked files in gitsubrepo
This follows normal Mercurial rules, and the message is lifted from
workingctx.add().  The file is printed with abs() to be consistent with how it
is printed in workingctx, even though that is inconsistent with how added files
are printed in verbose mode.  Further, the 'already tracked' notifications come
after all of the files that are added are printed, like in Mercurial.

As a side effect, we now have the reject list to return to the caller, so that
'hg add' exits with the proper code.  It looks like an abort occurs if git fails
to add the file.  Prior to touching 'snake.python' in the test, this was the
result of attempting to add the file after a 'git rm':

    fatal: pathspec 'snake.python' did not match any files
    abort: git add error 128 in s (in subrepo s)

I'm not sure what happens when git is a deep subrepo, but the 'in s' and
'in subrepo s' from @annotatesubrepoerror are redundant here.  Maybe we should
stat the files before invoking git to catch this case and print out the prettier
hg message?  The other thing missing from workingctx.add() is the call to
scmutil.checkportable(), but that would need to borrow the parent's ui object.
2015-02-27 23:30:42 -05:00
Matt Harbison
62fe6a5d98 subrepo: don't exclude files in .hgignore when adding to git
The previous test gave a false success because only an hg-ignored pattern was
specified.  Therefore match.files() was empty, and it fell back to the files
unknown to git.  The simplest fix is to always consider what is unknown to git,
as well as anything specified explicitly.  Files that are ignored by git can
only be introduced by an explicit mention in match.files().
2015-02-26 15:53:54 -05:00
Mads Kiilerich
e51a6aa2aa dirstate: clarify comment about leaving normal files undef if changed 'now'
Clarify that they only are saved as undef if they were marked as normal and
changed in the same second.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
b2b60414f6 spelling: fixes from proofreading of spell checker issues 2015-01-18 02:38:57 +01:00
Mads Kiilerich
31e148ed8a merge-tools: configuration for Beyond Compare on OS X
Based on the Linux configuration entry.
2015-02-27 21:42:58 +01:00
Mads Kiilerich
eedb4882ea convert: when converting from monotone, use the number 1 for close in extras
Monotone used '1' for close while core Mercurial use 1. Now, for consistency,
use the same value everywhere. It will be stored as a string anyway and the
change will not make any real difference.

(The actual value of 'close' doesn't matter as long as extras has such a key.)
2015-01-21 00:02:17 +01:00
Gregory Szorc
3a90558059 hgweb: extract changeset template mapping generation to own function
Similar in spirit to df435ff00d29, I want to write an extension to
make available extra template keywords so hgweb templates can include
extra data.

To do this today requires monkeypatching the templater, which I think is
the wrong place to perform this modification.

This patch extracts the creation of the templater arguments to a
standalone function - one that can be monkeypatched by extensions.

I would very much like for extensions to be able to inject extra
templater parameters into *any* template. However, I'm not sure the best
way to facilitate this, as hgweb commands invoke the templater before
returning and we want the extensions to have access to rich data
structures like the context instances. We need cooperation inside hgweb
command functions. The use case screams for something like internal-only
"hooks." This is exactly what my (rejected) "events" patch series
provided. Perhaps that feature should be reconsidered...
2015-03-02 15:07:18 -08:00
Matt Mackall
0c7d82b039 merge with stable 2015-03-02 17:32:37 -06:00
Pierre-Yves David
9d2643c9ed amend: check for directory renames for both merge parents (issue4516)
Before this change, amending a merge would lose the rename information for file
adding in the second parents and implicitly renamed into a new directory.

In case of the merge, we also look for directory rename data from the second
parent. This seems to fix the bug and does not show other issues from the test
suite.
2015-03-02 19:01:00 +00:00
Matt Mackall
a304fd5375 Added signature for changeset f515b8dd4d3f 2015-03-02 10:29:45 -06:00
Matt Harbison
721f888f2f transaction: really disable hardlink backups (issue4546) 2015-03-02 10:31:22 -05:00
Matt Mackall
f1585fbf2a Added signature for changeset 8b6d843300a0 2015-03-02 01:06:31 -06:00
Jordi Gutiérrez Hermoso
ed917f2095 revrange: don't parse revset aliases as hash prefixes (issue4553)
If a user has a revsetalias defined, it is their explicit wish for
this alias to be parsed as a revset and nothing else. Although the
case of the alias being short enough and only contain the letters a-f
is probably kind of rare, it may still happen.
2015-02-25 18:12:01 -05:00
Mathias De Maré
50bc3c4ab5 subrepos: support adding files in git subrepos
This support includes correct matching, so includes,
excludes and patterns are all supported.
2015-02-24 08:49:22 +01:00
Matt Harbison
5679b4cfdc subrepo: return only the manifest keys from hgsubrepo.files()
This is in line with the other subrepo classes (i.e. only the filenames are
returned).  Archive iterates over the manifest keys, and since subrepo archive()
uses this method, it does too now.  This will allow largefiles to override its
manifest keys to present the largefiles instead of the standins.  Once in place,
we shouldn't need the copy/paste overrides of archive and subrepo archive in
largefiles, that don't quite behave like the core methods they are overriding.
2015-02-15 17:29:10 -05:00
Matt Harbison
d3aeafb647 archive: change the default prefix to '' from None
All current callers supply some sort of prefix, so the issue was hidden.  But if
no parameter was specified, a crash occurred in the write() closure when
concatenating 'prefix' and 'name'.
2015-02-15 17:21:48 -05:00
Martin von Zweigbergk
3f4926eef3 debugsetparent: document one common caveat specifically
After calling debugsetparent, it's quite common that status is
incorrect. The command's help text already says that it should be used
with care, but let's describe this caveat explicitly since it's
probably the most common one.
2015-02-25 11:39:14 -08:00
Eric Sumner
a01d77c360 repair: setup hookargs when processing bundle2s
addchangegroup() modifies its behavior based on the transaction source.
This is incorrect for bundle2 repair files, causing rebases to abort when this
option is enabled.

This diff specifies the source type in the way recommended by comments in
bundle2.py and adds a test to ensure that rebases with the experimental option
work successfully.
2015-02-20 13:55:01 -08:00
Matt Mackall
5133130bdb merge with stable 2015-03-02 10:55:19 -06:00
FUJIWARA Katsunori
884a03f051 largefiles: avoid infinite recursive call of openlfdirstate in overriderevert
When there isn't lfdirstate file in cases below, "openlfdirstate()"
call "scmutil.match()" indirectly to build lfdirstate up.

  - subrepos disabling largefiles locally
  - lfdirstate file is missed accidentally

This causes infinite recursive call of "openlfdirstate()" in
"overriderevert()" (introduced by 25febe9568dd), because
"openlfdirstate()" is invoked from the function overriding
"scmutil.match()" itself.

To avoid infinite recursive call of "openlfdirstate()" in
"overriderevert()" in such cases, this patch passes "create=False"
argument to "openlfdirstate()".

"create=False" forcibly makes "openlfdirstate()" avoid code path to
build lfdirstate up.
2015-03-02 23:37:55 +09:00
Matt Mackall
b907416f7b merge with stable 2015-03-02 01:20:14 -06:00
Matt Harbison
b740e2a862 test-obsolete: use 'log -T {node}' instead of 'id --debug -i' to lookup hash
I ran into a case when adding a test where there were cryptic hg command line
errors.  I eventually traced it back to 'hg id' printing debug messages before
the hash:

    invalid branchheads cache (served): tip differs <hash>

This method should eliminate any other output except the node.
2015-02-28 01:12:54 -05:00
Matt Mackall
6decf56e3e merge with stable 2015-02-27 17:46:03 -06:00
Martin von Zweigbergk
9bb31557ba manifest: rename 'mf', 'map', and 'mapping' to 'm'
We mostly call manifest variables 'm', so let's use that in
manifest.py too. This makes it clearer that the variables do, in fact,
contain manifestsdict instances and never a plain dict.
2015-02-24 09:08:54 -08:00
Martin von Zweigbergk
4233d16798 manifest: make copy logic local to copy()
The optional arguments to the manfifestdict constructor are only used
by copy(), so assign the fields from that method instead so it's clear
that the arguments are not used for anything else.
2015-02-23 13:41:02 -08:00
Matt Harbison
7c735629be extensions: indicate loaded for an immediately called afterload callback
Otherwise, there's no way to tell between the immediate callback when it is
already loaded, and when the extension is not loaded at all.
2015-02-21 00:40:18 -05:00
Gregory Szorc
bcba93c7f5 tests: add test showing tags cache drops filtered heads (issue4550)
The tags cache can lose .hgtags filenode entries for filtered heads. Add
a test demonstrating this (bad) behavior.
2015-02-24 00:08:04 -08:00
Gregory Szorc
c3c80f0fa5 tags: write tags cache deterministically
An upcoming test verifies content of the .hg/cache/tags file. During
testing, inconsistent output was observed. This is the result of
iterating over a dictionary.

Throw a sorted() around tags entries to ensure .hg/cache/tags is written
deterministically so test output is stable.
2015-02-24 00:06:47 -08:00
Martin von Zweigbergk
07f7ea01b3 subrepo: add tests for change/remove conflicts
There are currently no tests for change/remove conflicts of subrepos,
and it's pretty broken. Add some tests demonstrating some of the
breakages and fix the most obvious one (a KeyError when trying to look
up a subrepo in the wrong context).
2015-02-17 23:20:55 -08:00
Anton Shestakov
b508925735 hgweb: recreate old DOM structure for css in monoblue style
There's a "p.changeset-age span" css block in style-monoblue.css with quite a
bit of rules, including position. They were all unused, since there weren't
matching span element inside the p.changeset-age.

The span was removed in 064b658181dd (as it seemed meaningless at the time?)
and since then relative changeset age text looked weird and broken.

"age" class is used for calculating relative changeset age in javascript: all
content of such element is replaced with human-friendly text (e.g.
"yesterday"). So the new span gets the age class.
2015-02-12 10:38:33 +08:00