Commit Graph

3412 Commits

Author SHA1 Message Date
Stanislau Hlebik
f39bc3ba1e remotefilelog: add linknode fixup logging
Summary:
The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.

Let's log more data to make it easier to analyze where and how often does
linknode adjusing happen.

Test Plan: Run test-remotefilelog-linknodes.t

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D838
2017-10-01 05:45:27 -07:00
Stanislau Hlebik
e6d7a411ed remotefilelog: remove copy-paste in fastlog logging
Summary:
The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.


Test Plan: Run test-remotefilelog-linknodes.t

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D837
2017-10-01 05:45:27 -07:00
Stanislau Hlebik
51e70d2c81 remotefilelog: move fastlog logging inside _linknodeviafastlog
Summary:
The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.

Let's store all the fastlog logging inside fastlog function. This refactoring helps in the next diffs

Test Plan: Run test-remotefilelog-linknodes.t

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D836
2017-10-01 05:45:27 -07:00
Stanislau Hlebik
527d3c5618 remotefilelog: change the name of logging category
Summary:
The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.

Let's change the name of the logging category. In the next diffs I'll add more
logging, not only related to fastlog, so current name may be misleading.

Test Plan: Run test-remotefilelog-linknodes.t

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D835
2017-10-01 05:45:27 -07:00
Stanislau Hlebik
07b4213604 sparse: fix check-commit test 2017-10-01 05:45:27 -07:00
Jun Wu
07643e2d99 undo: update test to reflect upstream changes
This is a simple `rt -i` fix for changes caused by upstream 83b647ce1cec and
976f5a9c1fd2. We probably want to change our template implementation to
de-dup hashes in the future.
2017-10-01 05:45:27 -07:00
Shravya Reddy Kuchikulla
3c9328d1ee sparse: add a --cwd-list option
This diff adds an option --cwd-list to hg sparse. This will return the
contents of the current directory.  The files that are in the sparse profile are
annotated with a '-' indicator.

Test Plan:
Tested by running the command 'hg sparse --cwd-list' in various folders.

Differential Revision: https://phab.mercurial-scm.org/D731
2017-10-01 05:45:27 -07:00
Diego Caballero
60ea7b5141 hg update hint
Differential Revision: https://phab.mercurial-scm.org/D834
2017-09-28 11:30:37 -07:00
Ryan McElroy
1ac1a987b3 fbamend: fix typo and shorten advice
Summary: Shorter and sweeter and hopefully more correct.

Reviewers: #fbhgext, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters

Differential Revision: https://phab.mercurial-scm.org/D827
2017-09-27 06:43:51 -07:00
Ryan McElroy
65cf7910fc tests: not rebasing now prints out names
Reviewers: #fbhgext, mjpieters

Reviewed By: mjpieters

Differential Revision: https://phab.mercurial-scm.org/D825
2017-09-27 06:43:51 -07:00
Ryan McElroy
5ab0d8e6cf tests: tip moved to after other names
Summary: Namespace order in rebase was changed in https://phab.mercurial-scm.org/D741

Reviewers: #fbhgext, mjpieters

Reviewed By: mjpieters

Differential Revision: https://phab.mercurial-scm.org/D824
2017-09-27 06:43:51 -07:00
Ryan McElroy
59d15d70c8 scm-prompt: fix single quotes showing up with no format string
Summary: Regression that wasn't tested by the tests before

Test Plan: This is now tested with a new test

Reviewers: #fbhgext, mjpieters

Reviewed By: mjpieters

Differential Revision: https://phab.mercurial-scm.org/D823
2017-09-27 06:43:51 -07:00
Ryan McElroy
3add344955 scm-prompt: update test for changed hg output
Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D822
2017-09-27 06:43:51 -07:00
Ryan McElroy
b20938c285 tweakdefaults: explicitly enable/disable single colon warning
Summary:
I think this is a better way of surfacing this warning. It also allows
us to tweak the message so we can point at new documentation I have already
written up.

Test Plan: Updated test

Reviewers: #fbhgext, mbthomas, durham, singhsrb

Reviewed By: #fbhgext, mbthomas, durham, singhsrb

Subscribers: singhsrb, quark

Differential Revision: https://phab.mercurial-scm.org/D812
2017-09-27 14:05:56 +01:00
Martijn Pieters
6f5e6b7d91 More test output fixing for debugobsolete 2017-09-27 03:59:30 -07:00
Saurabh Singh
4107b6303c tweakdefaults: fix test to avoid unnecessary double execution
D802 added two test cases in the test but the test cases are only used
for a very little portion of the test and therefore, result in needless double
execution for most of the test. Therefore, this commit removes the test cases
and instead, handles the different cases by passing the corresponding config
option.

Test Plan:
ran test-tweakdefaults.t

Differential Revision: https://phab.mercurial-scm.org/D814
2017-09-26 14:01:58 -07:00
Jun Wu
de4b9b241c hiddenoverride: do not resolve obsoleted revisions during startup
Resolving obsoleted revisions (`repo.revs('obsolete()')`) is slow. Let's
move that filtering logic from read code path to write code path. So it does
not get executed for every command.

Test Plan:
`hg bookmark --hidden --profile`. Make sure obsstore loading logic
disappears from the profiling output.

Differential Revision: https://phab.mercurial-scm.org/D806
2017-09-26 13:34:34 -07:00
Jun Wu
0578f57460 p4fastimport: do not break other extensions
p4fastimport's reposetup will break other lfs commands or verify. Let's
limit that side effect to p4fastimport related commands. So they won't
affect users with p4fastimport enabled.

Differential Revision: https://phab.mercurial-scm.org/D801
2017-09-26 13:34:34 -07:00
Martijn Pieters
1f6351d8a1 Update obstore tests 2017-09-26 09:11:19 -07:00
Martijn Pieters
c1934807f1 phabricator: handle non-JSON response gracefully
Tested by trying to connect to a non-phabricator URL that responds with HTML to
a POST request and by trying to run hg ssl when not on the corp network.

Depends on D799

Differential Revision: https://phab.mercurial-scm.org/D800
2017-09-26 12:04:22 +01:00
Martijn Pieters
6fa053053f phabricator: switch to urlgrabber for phabricator communications
http://urlgrabber.baseurl.org/ is available on both corp and prod, without
additional dependencies specified, and a simple API.

Differential Revision: https://phab.mercurial-scm.org/D799
2017-09-26 12:04:22 +01:00
Mark Thomas
a44fc44f24 sparse: add --sparse option to hg diff
Add a --sparse option to `hg diff` which filters the diff to include only files
that are part of the sparse profile.

When files are moved or copied across the sparse profile boundary, they will
show as added or removed (for moves) in the diff.  This is the same behaviour
as `hg diff --root`.

Test Plan:
Expand `tests/test-sparse-diff.t`

Differential Revision: https://phab.mercurial-scm.org/D797
2017-09-26 03:24:56 -07:00
Mark Thomas
b0c997501c sparse: get data for excluded files from working copy parent
When commands like 'diff' request the contents of files from a workingfilectx,
normally this is satisfied by reading from disk.  For files outside the sparse
checkout this doesn't work, so instead we must return the content from the
working copy parent.

Test Plan:
`tests/test-sparse-diff.t`

Differential Revision: https://phab.mercurial-scm.org/D788
2017-09-26 03:24:56 -07:00
David Soria Parra
11a84b900f p4fastimport we must return the value from the function we are decorating
We must correctly return the value from the function we are decorating.

Test Plan:
run tests

Differential Revision: https://phab.mercurial-scm.org/D767
2017-09-25 15:34:17 -07:00
David Soria Parra
3190a73f03 remotefilelog: rename nodehash to node
Use naming consistent with Mercurial conventions and call the result of
bin(id) a node.

Test Plan:
None

Differential Revision: https://phab.mercurial-scm.org/D766
2017-09-25 15:33:55 -07:00
Matt DeVore
f0acca7893 builddeb: remove leading "hg_" to make the Debian pkg version number valid
Differential Revision: https://phab.mercurial-scm.org/D813
2017-09-25 12:59:45 -07:00
Saurabh Singh
92177b3187 tweakdefaults: add config to enable/disable developer warnings
Summary:
Adding a config to control (only enable/disable for now) developer
warnings. This allows disabling the warnings on platforms like servers.

Test Plan: Updated and ran test-tweakdefaults.t

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D802
2017-09-23 16:58:58 -07:00
Matt DeVore
928a902f2a shallowbundle: make the generatemanifests method compatible with older Hg 2017-09-23 16:58:58 -07:00
Ryan McElroy
a6a9d48bfa scm-prompt: update developer note and follow its advice
Test Plan: `rt`

Reviewers: #fbhgext, stash, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D798
2017-09-22 10:33:24 -07:00
Shivram Khandeparker
7fcb01426a remotefilelog: using fastlog as a fast path to fix linkrev
Summary:
The _adjustlinknode function in remotefilectx currently has a slow case where
it must prefetch history from the server to lookup the correct linkcode.
This change makes use of fastlog (if enabled for the repo) to speed up the
linknode lookup as fastlog will already have the correct linkrev. If fastlog
is not enabled or the fastlog call fails for some reason then it will fall
back to the old method.

Test Plan: Added new test cases in test-remotefilelog-linknodes.t

Reviewers: ikostia, stash, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D620
2017-09-22 10:08:58 -07:00
Durham Goode
286d6bbe18 infinitepush: send treepack parts with the client push
This makes the client side pushes also include tree packs in the push.

Also adds a test to see that the tree parts round trip between two tree-only
clients.

Differential Revision: https://phab.mercurial-scm.org/D721
2017-09-22 08:55:56 -07:00
Durham Goode
d0ee81e289 infinitepush: serve trees from stored bundle when rebundling
When serving data from a stored bundle, if we need to rebundle the data first,
we need to make sure that the tree data stored within the bundle gets packaged
up as well.

If we're not rebundling, then things work fine as is since it just forwards the
parts along.

Differential Revision: https://phab.mercurial-scm.org/D720
2017-09-22 08:55:56 -07:00
Durham Goode
e9f972b87d infinitepush: support serving extra parts stored in the bundle
Previously, when serving the contents of a stored bundle, we would explicitly
pick out the changegroup and serve only that. Let's also send along all other
parts that are stored in the bundle.

At the moment the only other parts that are stored in the bundle are the ones in
the partforwardingwhitelist in processparts, which is only treemanifest packs
right now. Later we'll serve bookmarks using this same pattern.

Differential Revision: https://phab.mercurial-scm.org/D719
2017-09-22 08:55:56 -07:00
Durham Goode
295d56dc8d infinitepush: store received treepack parts
Makes the infinitepush server store the received treepack parts in the bundle.
Future patches will enable serving the trees from the bundle, and sending the
trees from the client.

Differential Revision: https://phab.mercurial-scm.org/D718
2017-09-22 08:55:56 -07:00
Durham Goode
70c2f9fa71 infinitepush: override processparts
Upstream Mercurial now has a function that handles the iteration over bundle
parts. As part of making infinitepush handle more part types, let's override
processparts and completely take over part processing.

Initially the part processing will just mimic the existing handlers, but there's
a config flag that causes it to simply redirect the received parts into the new
bundle. This will be useful later for storing all bundle parts (like tree packs
and obsmarkers).

Differential Revision: https://phab.mercurial-scm.org/D717
2017-09-22 08:55:56 -07:00
Durham Goode
434ef91f99 infinitepush: move bundle storing logic to its own function
Previously the logic that created a bundle from a changegroup part and put it in
the store was all in the same function. Let's split it up.

This will be useful in a later part where we stop using the default bundle2 part
handling logic and instead handle each part manually (allowing us to store other
parts in the bundle).

Differential Revision: https://phab.mercurial-scm.org/D716
2017-09-22 08:55:56 -07:00
Ryan McElroy
41d13b6d81 scm-prompt: standardize testing style and formatting
Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Subscribers: stash

Differential Revision: https://phab.mercurial-scm.org/D796
2017-09-22 08:31:06 -07:00
Ryan McElroy
fb2b108d94 scm-prompt: split into hg and git specific sub-functions
Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D795
2017-09-22 08:31:06 -07:00
Ryan McElroy
54b4eb4a85 scm-prompt: show elipsis only if there are additional remote bookmarks
Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Subscribers: stash

Differential Revision: https://phab.mercurial-scm.org/D794
2017-09-22 08:31:06 -07:00
Ryan McElroy
d2c869c6a5 scm-prompt: include .git in $git variable
Summary: Just as with the previous patch, this will reduce errors and cognitive overhead.

Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D793
2017-09-22 08:31:06 -07:00
Ryan McElroy
007c2161e8 scm-prompt: include .hg in $hg variable
Summary:
This has been a big source of confusion and errors when sporadically hacking on
this script that usually doubles the time it takes to add a new feature. This
is the more sane way to do it anyway.

Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D792
2017-09-22 08:31:06 -07:00
Ryan McElroy
0d434d8cbc scm-prompt: style cleanups
Test Plan: `rt`

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Subscribers: stash

Differential Revision: https://phab.mercurial-scm.org/D791
2017-09-22 08:31:06 -07:00
Ryan McElroy
68ea4e433c scm-prompt: add locked state
Summary:
If you're working n multiple terminals on the same repository, it is
often useful to know if a command you're about to run might block due to an
already-held lock on the repository. This upgrade to scm-prompt gives the
user this information.

Test Plan: updated the test

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Subscribers: stash

Differential Revision: https://phab.mercurial-scm.org/D790
2017-09-22 08:31:06 -07:00
Durham Goode
8b7529b24d tests: update tests after blackbox fix 2017-09-21 23:32:55 -07:00
Durham Goode
0db0ff98fc lint: fix lint issue 2017-09-21 23:21:18 -07:00
Durham Goode
999e3b7af5 remotefilelog: add seen set to annotate algorithm
The remotefilelog annotate logic was not keeping track of which commits it had
seen when doing the bfs ancestor walk. For very mergy histories this resulted in
a ton of duplicate work.

Differential Revision: https://phab.mercurial-scm.org/D771
2017-09-21 21:31:52 -07:00
Durham Goode
0e25d26f20 treemanifest: don't error out if a local commit doesn't have a tree
In hybrid tree/flat mode, if a local commit accidentally got marked as public,
then we would attempt to access the server, which of course didn't have the
commit and failed. This caused an error on the client, when in reality we
should've just fallen back to the flat manifest. Let's eat the error and the
message in this case.

Differential Revision: https://phab.mercurial-scm.org/D772
2017-09-21 21:23:40 -07:00
Durham Goode
0ce07c511d treemanifest: store p1,p2 in the temporary memtrees
Previously, if during the middle a transaction something needed to access a tree
for a commit that was created during the transaction, the manifestlog could find
that tree in a side store it kept for current transaction trees. Unfortunatley
we were only storing the data, and not the parents, so if logic needed the
parents it failed with a key error. The fix is to just store the parents as
well.

This was caught by the sparse extension, which looks at the current tree during
a commit when a sparse profile changes.
2017-09-21 21:23:40 -07:00
Jun Wu
99a01a0dbd dirsync: respect rule order
With rules of nested paths, the order of rules matters.

Note: this does not make dirsync handle recursive changes. i.e. a mirror
from path1 to path2 won't trigger a rule matching path2.

Differential Revision: https://phab.mercurial-scm.org/D770
2017-09-21 15:57:11 -07:00
Jun Wu
415f5074b3 undo: do not run undolog for every command
Previously, undolog runs for every command, which sometimes adds unwanted
noticeable overhead like `hg status` with a large obsstore. This patch makes
undo smarter to only log commands that actually write things.

This is done by making undolog only run for transactions, updates (legacy
code that does not require a transaction). Tests are changed to reflect
`hg status` does not trigger undolog, and the new code seems to work better
with chg.

Differential Revision: https://phab.mercurial-scm.org/D739
2017-09-21 14:38:43 -07:00