Commit Graph

18732 Commits

Author SHA1 Message Date
Bryan O'Sullivan
f023d03282 util: add functions to check symlink/exec bits
These are not yet used.
2013-04-03 11:35:27 -07:00
Augie Fackler
181c54db61 Merge with stable. 2013-04-03 13:03:50 -05:00
Siddharth Agarwal
070b188489 scmutil.addremove: use iteritems on walk results
Now that we no longer sort all the walk results, using iteritems becomes
possible.

This is a relatively minor speedup: on a large repository with 170,000 files,
perfaddremove goes from 2.13 seconds to 2.10.
2013-04-02 14:50:50 -07:00
Siddharth Agarwal
cf3792485f scmutil.addremove: stop sorting all walk results
The only place where the order matters is in printing out added or removed
files. We already sort that set.

On a large repository with 170,000 files, this speeds up perfaddremove from
2.34 seconds to 2.13.
2013-04-02 14:50:31 -07:00
Siddharth Agarwal
eff1b30357 scmutil.addremove: pull ui.status printing out of the loop
This will let us stop sorting all the results in an upcoming patch.

This also permits future refactorings where the same code consumes
dirstate.walk results but doesn't print anything out.

An argument could be made that printing out results as we go along is more
responsive UI-wise. However, at this point iterating through walk results is
actually faster than sorting them, so once we stop sorting all the results the
argument ceases to be valid.
2013-04-02 10:56:24 -07:00
Siddharth Agarwal
c4b1cf0480 scmutil.addremove: remove redundant directory and symlink checks
dirstate.walk only does lstats and never returns stat objects for directories.

On a large repository with 170,000 files, this speeds perfaddremove up from
2.40 seconds to 2.34.
2013-04-02 14:49:34 -07:00
Siddharth Agarwal
392b6d1872 scmutil.addremove: pull repo.dirstate fetch out of the loop
On a large repository with 170,000 files, this speeds up perfaddremove from
2.78 seconds to 2.40.
2013-04-02 14:46:55 -07:00
Isaac Jurado
5c5aad9d45 setup.py: properly discard trust warning.
This modification was missing from the 4a4aff3d70bd changeset.
2013-04-02 16:03:10 +02:00
Matt Mackall
6cef0d9472 Added signature for changeset 59e91fba46bf 2013-04-02 01:05:31 -05:00
Siddharth Agarwal
64922bc1af scmutil: remove dead updatedir code
This code has not been used in a long while.
2013-04-01 20:38:37 -07:00
Bryan O'Sullivan
82ca6ed101 merge with mpm 2013-04-02 08:58:42 -07:00
Siddharth Agarwal
b97fabd2e4 duplicatecopies: do not mark items not in the dirstate as copies
Consider the following repo:

  0 -- 1 (renames a to b)
    \
     - 2

If we're rebasing 2 onto 1, then duplicatecopies is called with arguments (2,
1). copies.pathcopies goes backwards from 1 to 0 and returns the pair dst = a,
src = b. Of course, since we're working on top of 2, at this point a doesn't
exist in the dirstate.

Extra entries in the copymap are currently harmless because the copymap is
only queried for items in the dirstate map. However, if the dirstate.copy
method becomes one of the sources used to determine which files have changed,
this will prove problematic.

Note that we can't avoid going backwards in general -- consider this repo:

  0 -- 1 (renames a to b)
    \
     - 2 (renames a to c)

Rebasing 2 onto 1 should produce a rename from b to c.
2013-03-28 18:27:19 -07:00
Siddharth Agarwal
218624d093 duplicatecopies: fix arg name and docstring
While most callers do indeed use duplicatecopies with a rev and its parent,
rebase doesn't.
2013-03-28 00:14:27 -07:00
Siddharth Agarwal
262d694589 pull: list bookmarks before pulling changesets (issue3873)
Consider a bookmark B that exists both locally and remotely. If B is updated
remotely, and then a pull is performed where the pull set contains the new
location of B, the bookmark is updated locally. However, if remote B is
updated in the middle of a pull to a location not in the pull set, the
bookmark won't be updated locally at all.

To fix this, list bookmarks before pulling in changesets, not after. This
still leaves a race open if B gets moved in between listing bookmarks and
pulling in changesets, but the race window is much smaller. Fixing the race
properly would require a bundle format upgrade.

test-hook.t's output changes because we no longer do two listkeys calls during
pull, just one.

test-pull-http.t's output changes because we now search for bookmarks before
searching for changes.
2013-03-29 19:54:06 -07:00
Siddharth Agarwal
9480bd91e6 test-hook.t: remove prelistkeys.forbid hook before moving on
An upcoming patch will change the order of operations and perform a listkeys
before a changegroup fetch. This will cause a few tests to print out the wrong
error message.
2013-03-29 19:52:02 -07:00
Siddharth Agarwal
109e952c51 bookmarks.updatefromremote: rename local rb to remotemarks
This local will become a parameter in an upcoming patch, so give it a more
descriptive name. The name stays similar to the existing localmarks.
2013-03-29 18:28:59 -07:00
Siddharth Agarwal
266855be39 pull: rename local rb to remotebookmarks
This local will become more important in an upcoming patch, so give it a more
descriptive name.
2013-03-29 19:06:23 -07:00
Siddharth Agarwal
c21872bb74 dicthelpers: inline diff and join code
mpm suggested this change since it improves performance slightly.

Benchmarking hg perfcalculate -r .

Before:
! wall 0.141173 comb 0.140000 user 0.140000 sys 0.000000 (best of 66)

After:
! wall 0.138619 comb 0.140000 user 0.140000 sys 0.000000 (best of 69)
2013-03-29 16:07:57 -07:00
Siddharth Agarwal
2b341c44b5 dicthelpers: add docstrings for diff and join 2013-03-29 15:23:19 -07:00
Bryan O'Sullivan
0c6ba243cb perf: add perfdirs command
This measures the cost of computing the dirstate's dirs structure,
which becomes very expensive in a large working directory.
2013-04-01 13:46:32 -07:00
Matt Mackall
5449719a55 merge with stable 2013-04-01 15:19:16 -05:00
Nikolaj Sjujskij
88b3e1a958 zsh_completion: fix trailing carriage return spoiling tag completion
This was giving the following error:

 % hg up 2.5-r<Tab>
 (eval):1: bad substitution
 % hg up 2.5-r
2013-03-29 18:45:07 -07:00
Matt Mackall
2ad3a48eb3 filesets: add eol predicate 2013-03-29 16:48:32 -07:00
Matt Mackall
0435af73d5 merge with stable 2013-03-29 15:27:33 -07:00
Matt Mackall
0e4e7a2ef3 merge with i18n 2013-03-29 15:27:11 -07:00
Bryan O'Sullivan
b9f58e03c3 perf: remove mysterious trailing newlines 2013-03-28 18:21:20 -07:00
Bryan O'Sullivan
0477147e50 blackbox: fix a few check-code portability errors 2013-03-27 09:00:43 -07:00
Bryan O'Sullivan
1d04c93909 check-code: fix a check-code failure in check-code
The irony is delicious.
2013-03-27 08:57:45 -07:00
Idan Kamara
8e15165a57 localrepo: always write the filtered phasecache when nodes are destroyed (issue3827)
When the strip command is run, it calls repo.destroyed, which in turn checks if
we read _phasecache, and if we did calls filterunknown on it and flushes the
changes immediately. But in some cases, nothing causes _phasecache to be read,
so we miss out on this and the file remains the same on-disk.

Then a call to invalidate comes, which should refresh _phasecache if it
changed, but it didn't, so it keeps using the old one with the stripped
revision which causes an IndexError.

Test written by Yuya Nishihara.
2013-03-23 13:34:50 +02:00
Bryan O'Sullivan
29e4e195d6 merge with stable 2013-03-19 16:19:20 -07:00
Durham Goode
83c3af4210 rebase: restore active bookmark after rebase --continue
When a rebase has conflicts and the user uses rebase --continue, the previously
active bookmark was not being made active once again. With this change that
bookmark is made active again, just as if the rebase had never been interrupted.

This changes the rebasestate file format, but should handle old formats correctly.
Since the file is transient, this is even less of a problem.

Adds a test to verify the new behavior. I manually tested continuing rebases
with and without an active bookmark, and with and without being on the bookmark
being rebased.
2013-03-11 15:37:28 -07:00
Benoit Boissinot
0d369ef57d setup.py: ignore warnings from obsolete
Fix version detection with recent hg versions.
2013-03-04 10:05:52 +01:00
Benoit Boissinot
ba8b143893 setup.py: add metadata to register package to PyPI
This allows updating PyPI with just 'setup.py register' (assuming the user is
an owner or maintainer of the PyPI package).
2013-03-04 10:13:28 +01:00
Wagner Bruna
98800b3eb0 merge with i18n 2013-03-01 11:54:36 -03:00
Matt Mackall
c6e1605063 Added signature for changeset 148259109d6c 2013-02-28 21:53:13 -06:00
Matt Mackall
5e321b6e3e setparents: drop copies from dropped p2 (issue3843) 2013-02-28 21:29:31 -06:00
Simon Heimberg
7dfe048bd9 check-code: re-add check for missing glob
As suggested by mpm reintroducing this test failure on windows is
prevented by a code-check. One line in a unix test is ignored.

This pattern matches 20 windows glob lines.
2013-03-01 00:59:22 +01:00
Simon Heimberg
6321f3dc40 tests: append missing glob to filename output and check-code it 2013-03-01 00:03:51 +01:00
Simon Heimberg
f94731fd38 check-code: extract windows glob warning message
it will be used often
2013-02-28 23:45:51 +01:00
Bryan O'Sullivan
e905def78f blackbox: defer opening a log file until needed (issue3869)
Previously, we opened the log file when creating a repo object. This
was inefficient (not all repo creation is going to result in a need to
log something), but more importantly it broke subrepo updates when used
on NFS.

* perform an update in the master repo that triggers a subrepo clone

* empty subrepo already exists, and has an open, empty blackbox.log file
  due to it being opened eagerly/prematurely

* hg decides to blow away the skeletal subrepo (see use of shutil.rmtree
  in subrepo._get)

* we crash, due to NFS treating a delete of an open file as really a
  rename to a hidden ".nfs" file

Now that we open the blackbox log file on demand, no file exists at the
time the empty subrepo is deleted, so the above problem does not occur.
2013-03-26 16:27:51 -07:00
Sean Farley
0a28dbdae7 patch: match 'diff --git a/' instead of 'diff --git'
This reduces the likelihood of a traceback when trying to email a
patch that happens to have 'diff --git' at the beginning of a line
in the description, as this patch did:

http://markmail.org/message/wxpgowxd7ucxygwe
2013-03-22 17:27:06 -05:00
Simon Heimberg
0f30974d2c color: drop unnecessary global statement 2013-03-21 18:16:49 +01:00
Simon Heimberg
da12bc2332 serve: pass on the repo instad of recreating it in hgweb
When we pass on the path to the repo, the repo is created in hgweb. But the
repo is already here, so pass it on.
2013-03-21 18:16:49 +01:00
Simon Heimberg
f4736156b4 serve: pass the prepared baseui to hgweb
The baseui was carefully prepared but not used.
ui can contain repo specific settings which can have unwanted effects.
2013-03-21 18:16:48 +01:00
Simon Heimberg
6da920afed hgweb: do not pass on repo.ui when recreating a repo
Recreate the repo with the global configuration in repo.baseui. The repo
configuration is reread anyway. And now deleted repo configuration is reset to
the default value.
2013-03-21 18:16:48 +01:00
FUJIWARA Katsunori
4e03da490f i18n-ja: synchronized with 10161c15d778 2013-03-01 03:25:19 +09:00
Mads Kiilerich
93a2b8faf0 templatefilters: add missing import of _ 2013-02-28 13:55:00 +01:00
Mads Kiilerich
335985feed largefiles: updatelfiles should use working dir standins, not standins from p1
This makes a difference when working directory is dirty, especially when
merging with a revision for which we don't have largefiles.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
090ace70e1 largefiles: simplify cachelfiles - don't spend a lot of time checking hashes
cachelfiles jumped through loops to handle merges and modified files ... but it
did apparently no longer have a valid reason to do so. It should just always
make sure that the largefiles referenced from the standins are present - no
matter which actual largefile is stored in the working directory. If there is
no standin then there is nothing to fetch.

The old code usually verified the hash of all largefiles every time this
function was invoked - for examply by 'update'.

This change makes a trivial noop update 5-10 seconds faster on our repo (with
the other 50% spent doing another unnecessary hashing of all largefiles).
2013-02-28 13:45:18 +01:00
Mads Kiilerich
1d9aca9cb3 largefiles: don't let update leave wrong largefiles in wd if fetch fails
Situations where a largefile for some reason wasn't available sometimes caused
wrong largefile content and state. It has mostly been seen when interrupting
download of largefiles ... and when introducing programming errors.

Instead we now make sure to delete the old and wrong largefile. A missing file
is a well-known error condition and much more reasonable way to handle the
situation.
2013-02-28 13:45:18 +01:00