Commit Graph

20293 Commits

Author SHA1 Message Date
Lucas Moscovicz
ab42b4bbc5 revset: added lazyset implementation to desc revset
Performance benchmarking:

$ time hg log -qr "first(desc(hg))"
changeset:   0:3a6a38229d41

real  0m2.210s
user  0m2.158s
sys 0m0.049s

$ time ./hg log -qr "first(desc(hg))"
changeset:   0:3a6a38229d41

real  0m0.171s
user  0m0.131s
sys 0m0.035s
2014-01-30 15:39:56 -08:00
Lucas Moscovicz
6ba591c77e revset: added lazyset implementation to draft revset 2014-02-03 16:15:25 -08:00
Lucas Moscovicz
57e67b73a7 revset: added lazyset implementation bookmark revset 2014-01-29 15:23:16 -08:00
Lucas Moscovicz
28688b6d54 revset: added lazyset implementation to date revset
Performance Benchmarking:

$ time hg log -qr "first(date(05/03/2005))"
0:3a6a38229d41

real  0m3.157s
user  0m2.994s
sys 0m0.087s

$ time ./hg log -qr "first(date(05/03/2005))"
0:3a6a38229d41

real  0m0.509s
user  0m0.289s
sys 0m0.070s
2014-02-03 16:02:48 -08:00
Lucas Moscovicz
d80d16c98c revset: added lazyset implementation to author revset
Performance benchmarking:

$ time hg log -qr "first(author(mpm))"
0:3a6a38229d41

real  0m3.486s
user  0m3.317s
sys 0m0.077s

$ time ./hg log -qr "first(author(mpm))"
0:3a6a38229d41

real  0m0.551s
user  0m0.295s
sys 0m0.072s
2014-01-29 09:22:31 -08:00
Lucas Moscovicz
fe40abc599 revset: added lazyset implementation to keyword revset
Performance benchmarking:

$ time hg log -qr "first(keyword(changeset))"
0:3a6a38229d41

real  0m3.466s
user  0m3.345s
sys 0m0.072s

$ time ./hg log -qr "first(keyword(changeset))"
0:3a6a38229d41

real  0m0.365s
user  0m0.199s
sys 0m0.083s
2014-01-29 09:04:03 -08:00
Lucas Moscovicz
303bd9d554 revset: changed limit revset implementation to work with lazy revsets
Performance benchmarking:

$ time hg log -qr "first(branch(default))"
0:3a6a38229d41

real  0m3.130s
user  0m3.025s
sys 0m0.074s

$ time ./hg log -qr "first(branch(default))"
0:3a6a38229d41

real  0m0.300s
user  0m0.198s
sys 0m0.069s
2014-01-28 16:19:30 -08:00
Lucas Moscovicz
7a6ce89407 revset: added lazyset implementation to branch revset
Performance Benchmarking:

$ time hg log -l1 -qr "branch(default)"
0:3a6a38229d41

real  0m3.366s
user  0m3.217s
sys 0m0.095s

$ time ./hg log -l1 -qr "branch(default)"
0:3a6a38229d41

real  0m0.389s
user  0m0.199s
sys 0m0.061s
2014-02-05 16:12:03 -08:00
Simon Heimberg
9d8139803a run-tests: fix typo and print out failing line
Instead of stripping the newline and printing the line, only the newline was
printed.
The output on buildbot will make more sense now.
2014-02-11 01:15:07 +01:00
Lucas Moscovicz
0ff716dae6 revset: changed getset so that it can return a lazyset
Not converting it manually to a baseset anymore. At this point every revset
method should return a baseset typed structure.
2014-01-28 15:19:14 -08:00
Lucas Moscovicz
e0f8aa1f35 hgext: updated extensions to return a baseset when adding symbols 2014-02-11 09:00:38 -08:00
Pierre-Yves David
48473f3287 push: move phases synchronisation function in its own function
Now that every necessary information is held in the `pushoperation` object, we
can finally extract the phase synchronisation phase to it's own function. This
is the first concrete block of code we extract from the huge push function.
Hooray!

This changeset is pure code movement only.
2014-01-30 20:22:43 -08:00
Pierre-Yves David
a17a66f49e push: move outgoing object in the push object
The set of outgoing and common changeset are used by phases to compute the new
common set between local and remote. So we need to move it into the object to
extract the phase sync from the god function.

Note that this information will be used by obsolescence markers too.
2014-01-30 20:18:26 -08:00
Pierre-Yves David
d37c15cc69 push: move push return value in the push object
The return code convey information about the success of changeset push. This is
used by phases to compute the new common set between local and remote. So we
need to move it into the object to extract the phase sync from the god
function.

Note that this information will be used by obsolescence markers too.
2014-01-30 19:43:28 -08:00
Pierre-Yves David
01ce069d96 push: move local phase move in a normal function
We now have the modularity for simpler approach `localphasemove`.
2014-01-30 20:10:59 -08:00
Pierre-Yves David
cad91f44e1 push: explicitly feed pushop to localphasemove
Now that pushop is holding all the push related data, we do not really need a
closure anymore. So we start feeding the object to `localphasemove` and will
make it a normal function in the next commit.
2014-01-30 20:09:21 -08:00
Pierre-Yves David
229e0e4cb0 push: move local lock logic in pushoperation
During push, we try to lock the local repo to move local phase according to what
we saw/pushed on the remote repo. Locking the repo may fail, in that case we let
the push proceed without local phase movement (printing warning).

This mean we have code in phase synchronisation that will check if the local repo is
locked or not. we need to move this information in the push object to be able to
extract the phase synchronisation in its own function. This is done as a boolean
because putting reference to the actual lock outside of the main function
sounded a bad idea.
2014-01-30 20:00:34 -08:00
Pierre-Yves David
018f4f94d4 push: move obsolescence related message into _pushobsolescence function
No good reason to have them in the main fonction.
2014-01-30 19:55:09 -08:00
Pierre-Yves David
fdca8c570d push: drop now outdated comment
This `_pushobsolete` now exist for modularity purpose.
2014-01-30 19:51:21 -08:00
Pierre-Yves David
0259725b46 push: feed pushoperation object to _pushobsolete function
This will allow the obsolete marker synchronisation to have full
information on the ongoing push and pass information to other
operation.
2014-01-30 17:56:09 -08:00
Pierre-Yves David
97a8524afb push: move obsolescence marker exchange in the exchange module
The obsolescence marker exchange code was already extracted during a previous
cycle. We are moving the extracted functio in this module. This function will
read and write data in the `pushoperation` object and I prefer to have all core
function collaborating through this object in the same place.

This changeset is pure code movement only. Code change for direct consumption of
the `pushoperation` object will come later.
2014-01-30 17:54:47 -08:00
Pierre-Yves David
d2cbf08f57 push: feed pushoperation object to _pushbookmark function
This will able the bookmark synchronisation to have full information on the
ongoing push and pass information to other operation.
2014-01-30 17:51:41 -08:00
Matt Mackall
fd00785c66 merge with stable 2014-02-10 17:31:26 -06: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
Lucas Moscovicz
fb15b99ea8 revset: added operations to duck type baseset
Added more operations which are not lazy but only used so far to duck type
baseset.

Their implementations will be changed in future patches.
2014-02-06 14:29:37 -08:00
Lucas Moscovicz
dd14a88eaa revset: added basic operations to lazyset
Added methods __add__, __sub__ and __and__ to duck type more methods in
baseset
2014-02-06 14:25:37 -08:00
Lucas Moscovicz
939eba25eb revset: added lazyset class with basic operations
This class allows us to return values from large revsets as soon as they are
computed instead of having to wait for the entire revset to be calculated.
2014-02-06 14:19:40 -08:00
Simon Heimberg
748f958f1a tests: test that the pid returned by hg serve looks reasonable
This failed on windows before win32.spawndetached has been fixed. The process
name was "cmd.exe" and not "hg.exe" or "python.exe".
2014-02-09 00:26:01 +01:00
Simon Heimberg
7b0d35f51c win32: spawndetached returns pid of detached process and not of cmd.exe
win32.spawndetached starts the detached process by `cmd.exe` (or COMSPEC). The
pid it returned was the one of cmd.exe and not the one of the detached process.
When this pid is used to kill the process, the detached process is not killed,
but only cmd.exe.

With this patch the pid of the detached process is written to the pid file.
Killing the process works as expected.

The pid is only evaluated on writing the pid file. It is unnecessary to search
the pid when it is not needed. And more important, it probably does not yet
exist right after the cmd.exe process was started. When the pid is written to
the file, waiting for the start of the detached process has already happened.
Use this functionality instead of writing a 2nd wait function.

Many tests on windows will not fail anymore, all those with the first failing
line "abort: child process failed to start". (The processes still hanging
around from previous test runs have to be killed first. They still block a
tcp port.)
A good test for the functionality of this patch is test-treediscovery.t,
because it starts and kills `hg serve -d` several times.
2014-02-08 14:35:07 +01:00
Lucas Moscovicz
5ea4d9b527 revset: minor changes adding baseset to revsets
Changed bits of code to work with baseset implementations.
2014-02-06 14:57:25 -08:00
Simon Heimberg
617e52dc43 tests: rewrite path in test-shelve.t for not being mangled on msys
msys (on windows) converets '-R bundle:.XX/XX' to '-R bundle:;.XX/XX'. Avoid
this by writing '-R bundle://.XX/XX'. This is used more often than the
alternative work arounds like '-Rbundle://.XX/XX' or '-R bundle:Y/../.XX/XX'.
2014-02-10 22:56:10 +01:00
Matt Mackall
35b203d694 merge with stable 2014-02-09 18:36:37 -06:00
Mads Kiilerich
673ec76229 convert: secret config option for disabling debugsvnlog
Subversion issues involving svn log such as 1e493b49245f can be tricky to
debug when it is run in an 'hg debugsvnlog' sub process. Debugging is simpler
when convert only uses one process.

With this change convert will invoke the svn log directly when setting
  [convert]
  svn.debugsvnlog = False

This is intentionally not documented.
2014-02-07 17:29:37 +01:00
Mads Kiilerich
17aeb0d9e4 convert: make subversion revsplit more stable when meeting revisions without @
revsplit would crash for instance if given a subversion string without @ ...
and that could somehow happen when playing around with convert.
2014-02-07 17:28:37 +01:00
Lucas Moscovicz
c5d089f8a5 revset: minor changes adding baseset to revsets
Changed bits of code to work with baseset implementations.
2014-02-06 14:57:25 -08:00
Lucas Moscovicz
91dcdf4e40 revset: added __add__ method to baseset class 2014-02-06 11:37:16 -08:00
Lucas Moscovicz
03857b594a revset: added docstring to baseset class 2014-02-06 11:33:36 -08:00
Mads Kiilerich
64b341109f shelve: better (and slightly redundant) test coverage for unshelve conflicts 2014-02-10 00:54:40 +01:00
Mads Kiilerich
2f8ea0775f shelve: status messages from unshelve
It was hard for the user to know what was going on when unshelving - especially
if the user had to resolve conflicts and thus got to see the intermediate
states.

Seeing that pending changes was gone could scare the user, make him panic, and
do stuff that really made him lose data.

Merging (both when rebasing and with pending changes) also requires some
understanding of where in the process you are and what you are merging.

To help the user we now show a couple of status messages (when relevant):
  temporarily committing pending changes (restore with 'hg unshelve --abort')
  rebasing shelved changes
2014-02-10 00:54:27 +01:00
Mads Kiilerich
bdf9713a66 shelve: be quiet when unshelve pulls from the shelve bundle
unshelve was quite verbose and it was hard for a user to follow what really was
going on. It ended up saying 'added 1 changesets' ... but the user just
expected and got pending changes and never saw any changeset.

The use of bundles is an implementation detail that we don't have to leak here.

Pulling is quite verbose, optimized for pulling many changesets from remote
repos - that is not the case here.

Instead, set the quiet flag when pulling the bundle - not only when temporarily
committing pending changes.

The 'finally' restore of ui.quiet is moved to the outer try/finally used for
locking.
2014-02-10 00:54:12 +01:00
Mads Kiilerich
a9a1d1164b shelve: add 'changes to' prefix to default shelve message
The shelved changes _could_ perhaps be amended to the parent changeset but it
_is_ not the parent changeset. Using the description from the parent changeset
is thus wrong and confusing.

Instead, add a 'changes to' prefix.
2014-02-10 00:53:27 +01:00
Mads Kiilerich
413adcdee8 shelve: mention FILE options in help
Shelve do normally take a list of files or patterns to shelve and the command
summary should thus show [FILE]...

Note: --delete is a bit special and interpret the parameters as a list of
shelve names. This change makes that even less obvious from the help. Too bad
- we can't please everyone.
2014-02-10 00:53:27 +01:00
Mads Kiilerich
260919a724 shelve: mention walk options in help 2014-02-10 00:53:25 +01:00
Mads Kiilerich
babd17546d shelve: really pass publicancestors to changegroupsubset - not the parents
publicancestors returned the parents of the public ancestors ... and
changegroupsubset used the parents of these as base for the bundle. That gave
bundles with one layer of changesets more than necessary.
2014-02-10 00:52:56 +01:00
Mads Kiilerich
057621541a shelve: publicancestors do not have to visit nullrev
Not visiting nullrev seems more correct and might be a minor optimization.
2014-02-10 00:52:46 +01:00
Mads Kiilerich
a649a1436b localrepo: make it clear that changegroupsubset doesn't take bases but roots
changegroupsubset will take the parents of the roots to find the bases.

Other parts of Mercurial do not expect that, and a result of that is that some
bundles contain more changesets than necessary.

No real changes here - just renaming a parameter to document what it is.
2014-02-10 00:52:16 +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
Augie Fackler
859551f9b1 repoview: use repo.revs() instead of a private revset method
Breaks an import cycle.
2014-02-04 17:13:45 -05:00
Augie Fackler
888bc814fa commands: use ctx.getfileset instead of fileset.getfileset 2014-02-04 14:55:04 -05:00