Commit Graph

27243 Commits

Author SHA1 Message Date
Matt Mackall
13d86f9294 verify: clean up weird error/warning lists
Nested functions in Python are not able to assign to variables in the
outer scope without something like the list trick because assignments
refer to the inner scope. So, we formerly used a list to give an
object to assign into.

Now that error and warning are object members, the [0] hack is no
longer needed.
2015-12-20 16:33:44 -06:00
timeless
78ff92a147 diff: clarify comparison as first parent 2015-12-18 18:52:25 +00:00
timeless
4d95bd2b9d histedit: add progress support 2015-12-18 06:19:22 +00:00
Yuya Nishihara
ca75b0a3eb verify: remove unreachable code to reraise KeyboardInterrupt
KeyboardInterrupt should never be caught as it doesn't inherit Exception in
Python 2.5 or later. And if it was, "interrupted" would be printed twice.

https://docs.python.org/2.7/library/exceptions.html#exception-hierarchy
2015-12-20 18:38:21 +09:00
Matt Mackall
c90437b804 merge with stable 2015-12-20 16:34:54 -06:00
Martin von Zweigbergk
0a6dbcd4ad revlog: fix bad indentation (replace tab by space) 2015-12-18 20:54:41 -08:00
Durham Goode
1f8eab7615 verify: move exc() function onto class
This is part of an effort to make verify more modular so extensions can hook
into it.
2015-12-18 16:42:39 -08:00
Durham Goode
43f6f64559 verify: move err() to be a class function
This is part of an effort to make it easier for extensions to hook into verify.
2015-12-18 16:42:39 -08:00
Durham Goode
fc349ab32f verify: move warn() to a class level function
This is part of the effort to make verify more modular so extensions can hook
into it more easily.
2015-12-18 16:42:39 -08:00
Durham Goode
37c5c70102 verify: move fncachewarned up to a class variable
This is part of making verify more modular so hooks can extend it.
2015-12-18 16:42:39 -08:00
Durham Goode
81530280b2 verify: move widely used variables into class members
This will allow us to start moving some of the nested functions inside verify()
out onto the class.

This will allow extensions to hook into verify more easily.
2015-12-18 16:42:39 -08:00
Durham Goode
21a5133eda verify: move verify logic into a class
In order to allow extensions to hook into the verification logic more easily, we
need to refactor it into multiple functions. The first step is to move it to a
class so the shared state can be more easily accessed.
2015-12-18 16:42:39 -08:00
Matt Harbison
85a68ab949 test-install: perform the wix checking on wdir() instead of "."
This allows catching problems before they are committed.
2015-12-17 21:18:02 -05:00
Laurent Charignon
5e7ee9a128 log: speed up hg log <file|folder>
This patch makes hg log <file|folder> faster by using changelog.readfiles
instead of changelog.read.
On our large repos for hg log <file|folder> -l5 operations that were taking:
- ~8s I see a 25% improvement
- ~15s, I see a 35% improvement
For recently modified folder/file, the difference is negligible as we don't
have to consider many revisions.
2015-12-18 12:54:45 -08:00
Laurent Charignon
be5dd01ee1 changelog: add a new method to get files modified by a changeset
This patch adds a new method "readfiles" to get the files modified by a
changeset. It extracts some logic from "read" to only return the files modified
by a changeset as efficiently as possible. This is used in the next patch to
speed up hg log <file|folder>
2015-12-18 13:45:55 -08:00
Gregory Szorc
2632a8c77a revlog: seek to end of file before writing (issue4943)
Revlogs were recently refactored to open file handles in "a+" and use a
persistent file handle for reading and writing. This drastically
reduced the number of file handles being opened.

Unfortunately, it appears that some versions of Solaris lose the file
offset when performing a write after the handle has been seeked.

The simplest workaround is to seek to EOF on files opened in a+ mode
before writing to them, which is what this patch does.

Ideally, this code would exist in the vfs layer. However, this would
require creating a proxy class for file objects in order to provide a
custom implementation of write(). This would add overhead. Since
revlogs are the only files we open in a+ mode, the one-off workaround
in revlog.py should be sufficient.

This patch appears to have little to no impact on performance on my
Linux machine.
2015-12-17 17:16:02 -08:00
Matt Harbison
3cab7ba2f7 tests: convert directory separators to '/' for MSYS in test-check-py-compat
This is the same fix as ca24c20a1c94.
2015-12-16 17:22:37 -05:00
Matt Harbison
6d5700eb1f tests: make pwd URL compatible on Windows in test-default-push
Without this, the test fails with:

  $ hg -q commit -A -m 'add pushurl'
  abort: file:// URLs can only refer to localhost
  $ hg push
  abort: file:// URLs can only refer to localhost

The variable $PWD causes check-code to complain, so avoid that.
2015-12-16 17:17:36 -05:00
Matt Harbison
3d1b5ddf9f windows: correct the import of win32
This module is relative, and was overlooked when converting to absolute_import
in 8474b52419b8.
2015-12-16 13:33:43 -05:00
Pascal Quantin
edc138619b win32: add internals help topics to Inno Setup installer 2015-12-17 19:33:44 +01:00
Augie Fackler
e4e988fdf5 changegroups: add documentation for cg3 2015-12-18 09:57:35 -05:00
Mike Edgar
44af48ee4a changegroup: add flags field to cg3 delta header
This lets revlog flags be transmitted over the wire. Right now this is
useful for censored nodes and for narrowhg's ellipsis nodes.
2015-12-14 15:55:12 -05:00
Augie Fackler
d33d6a0cb5 changegroup: introduce cg3, which has support for exchanging treemanifests
I'm not entirely happy with using a trailing / on a "file" entry for
transferring a treemanifest. We've discussed putting some flags on
each file header[0], but I'm unconvinced that's actually any better:
if we were going to add another feature to the cg format we'd still be
doing a version bump anyway to cg4, so I'm inclined to not spend time
coming up with a more sophisticated format until we actually know what
the next feature we want to stuff in a changegroup will be.

Test changes outside test-treemanifest.t are only due to the new CG3
bundlecap showing up in the wire protocol.

Many thanks to adgar@google.com and martinvonz@google.com for helping
me with various odd corners of the changegroup and treemanifest API.

0: It's not hard refactoring, nor is it a lot of work. I'm just
disinclined to do speculative work when it's not clear what the
customer would actually be.
2015-12-11 11:23:49 -05:00
Matt Mackall
e061768384 merge with stable 2015-12-18 14:40:11 -06:00
Augie Fackler
1b827711c9 manifestmerge: have manifest do matching before diffing
This means that the diff code does less work, potentially
significantly less in the case of treemanifests. It also should ease
implementation with narrowed clone cases (such as narrowhg) when we
don't always have the entire set of treemanifest revlogs locally.

As far as I can tell, this codepath is currently only used by record,
so it'll probably die in the near future, and then narrowhg won't have
to worry about composing with some unknown matching system.
2015-12-14 20:57:21 -05:00
timeless
8634803214 branch: reword help text
We're not necessarily talking about *the* active branch,
just any old branch.
2015-12-17 14:57:20 +00:00
timeless
c8d8d5d5ad archive: adjust help text 2015-12-17 14:56:32 +00:00
timeless
b6b262b427 annotate: add missing period to help 2015-12-17 14:54:47 +00:00
timeless
81c1e01972 addremove: make help match add 2015-12-17 14:54:20 +00:00
timeless
86a42ddbf7 add: mention .hgignore in help 2015-12-17 14:53:40 +00:00
timeless
ef7cfdfced bundle: warn for --base with --all 2015-12-17 15:05:25 +00:00
timeless
3db2ef2e04 bundle: fix error for --all with destination
Before it complained about --base
2015-12-17 15:03:45 +00:00
timeless
82d910c7aa bundle: fix grammar in help text 2015-12-17 14:59:11 +00:00
timeless
9c4b396c3c bundle: clarify help text
The file might not be compressed; the interactions between
-a, --base, and a named or default repository weren't clear.
2015-12-17 14:58:52 +00:00
Yuya Nishihara
664cff6605 cmdutil: do not duplicate stdout by makefileobj()
It made output order unpredictable because two separate buffers are flushed
individually. Let's use a thin wrapper that just sends close() to black hole.
2015-12-13 20:07:19 +09:00
Yuya Nishihara
db7707d747 cmdutil: reimplement file wrapper that disables close()
There's no need to dynamically create wrappedfileobj class and define
close() as lambda. Also, __iter__() was missing.
2015-12-13 20:01:11 +09:00
Yuya Nishihara
3a0b98410a export: remove useless comparison between file object and string
It was introduced at fa80944106df, where "template" argument could be a file
object. After that, 426525670e45 added "len(template)", so "template" must be
a string now. Therefore, "fp != template" should always be True.

It seems fa80944106df was intended to work around a bug in TortoiseHg, and
I'm sure I've fixed it completely in TortoiseHg source.

https://selenic.com/pipermail/mercurial-devel/2011-February/028467.html
2015-12-13 19:57:54 +09:00
Yuya Nishihara
00a04ad77b export: do not print '<fdopen>' as an output filename
Because makefileobj() duplicates or wraps stdout, "fp != sys.stdout" didn't
work correctly. Python doc states that special file objects are named in the
form '<...>', and absolute filenames should never start with '<', we can
ignore names start with '<'. We can't test fp.fileno() because fp may be a
command-server channel.

https://docs.python.org/2.7/library/stdtypes.html#file.name

In the test output, "exporting patch:" line is printed after patch content.
This is caused by fdopen() and will be fixed by the subsequent patch.
2015-12-13 19:47:46 +09:00
Yuya Nishihara
f7f67c678f commandserver: implement name() to clarify channel is not a plain file
Because unknown attributes are delegated to the underlying file object,
commandserver channels said they were '<stdout>' or '<stdin>' even though
they weren't. This patch makes them say '<X-channel>'.
2015-12-13 19:32:01 +09:00
Mateusz Kwapich
011f0f625e histedit: delete to drop
The default behaviour to forbid this makes a lot of sense for novice users
because it's safeguarding them from dangerous behavior but making it
configurable will be apprieciated by power users in at least one big
organization.

It allows an user to look an histedit rules from declarative perspective and
make the rules reflect the state after histedit.  If we can move lines t move
commits why can't we drop lines to drop commits?

Let's put this behind config knob and inform users about this feature the very
moment they are trying to use it so they can choose desired behaviour.
2015-12-15 13:27:09 -08:00
Mathias De Maré
0e11ed0ee2 clonebundles: fix bundlespec typo 2015-12-16 12:33:54 +01:00
timeless
b7d4dff7f3 record: fix hunk handling to remember the current function 2015-12-17 20:13:29 +00:00
timeless
1054dbcfef record: turn on showfunc
Always try to give diff context when doing an interactive record
2015-12-17 14:38:22 +00:00
Bryan O'Sullivan
509e69c982 parsers: use PyTuple_Pack instead of manual list-filling
Suggested by Yuya.
2015-12-17 13:07:34 -08:00
Thu Trang Pham
3d4e42b9c9 tags: mention --quiet switch in help (issue4920) 2015-12-17 15:23:36 -08:00
Matt Mackall
356bea2fb3 merge with stable 2015-12-17 17:27:32 -06:00
timeless
2abe9172f6 histedit: omit useless message from update (edit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:04:17 +00:00
timeless
26fb25b6cd histedit: omit useless message from update (_histedit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:37:31 +00:00
timeless
5551448efc histedit: omit useless message from update (histeditaction)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 21:43:16 +00:00
timeless
44748f7f11 update: add quietempty flag to _showstats
if called with quietempty=True, suppress:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:14:06 +00:00