Commit Graph

7473 Commits

Author SHA1 Message Date
Liubov Dmitrieva
fae5eb92e5 remotefilelog: add missing import of node.hex
Summary:
wrong hex function was used

it should be converting node to hex representation rather than hex() built-in functions

Reviewed By: markbt

Differential Revision: D9309663

fbshipit-source-id: 3f245353403964acbcfaa7fa3f4baf0da9aa9a25
2018-08-13 18:35:35 -07:00
Jun Wu
bfdb697078 lock: rename remaining e.locker to e.lockinfo
Summary: There are some leftovers uncaught by tests.

Reviewed By: singhsrb

Differential Revision: D9301679

fbshipit-source-id: 0178266a8f442a3d38288a21219af498ab9e3faa
2018-08-13 15:06:56 -07:00
Jun Wu
2682422a3e uncommit: fix "restoring deletion" case for treestate
Summary:
The uncommit command does some low-level changes to dirstate - it changes the
parents without updating the tree. Then it uses traditional dirstate APIs to
update the tree.

Treestate and traditional dirstate differ on the "remove" API - treestate would
make it a no-op-ish if the file is not already tracked. Traditional dirstate
would create such an entry blindly and then mark it as "removed".

Treestate cannot simply create the entry because it needs "EXIST_P1" or
"EXIST_P2" information, which is outside the "remove" API itself.

To fix this, teach "uncommit" to write a treestate entry in this case.

The longer term fix would probably be removing the low-level "setparents"
calls.

Reviewed By: DurhamG

Differential Revision: D9282452

fbshipit-source-id: 9a0f0ac2f1bc2a4296c10f95819457f4f9585a82
2018-08-13 08:35:43 -07:00
Jun Wu
9fa5c9778f cleanobsstore: do not use unicode_literals
Summary:
The config parser (and the reset of Mercurial) API expects bytes.

Passing unicode literals will cause TypeError with the native config parser.

Reviewed By: DurhamG

Differential Revision: D8960875

fbshipit-source-id: 5d788947b9d57bf3bc009a8237602b0ff862b05e
2018-08-09 21:21:52 -07:00
Jun Wu
cff15c8654 fbshow: do not pass non-string config name to ui.setconfig
Summary:
The old code is passing tuples like `("B", "ignore-blank-lines", None, _("ignore changes whose lines are all blank"))`
as config name to `ui.setconfig`, which is clearly wrong.

Also, the CLI flag does not match configs in the `[diff]` config section, ex.
`diff.ignore-blank-lines` is not the config option. `diff.ignoreblanklines` is.
`diff.ignore-all-space` is not the config option. `diff.ignorews` is.

The diffopts config overrides are not necessary since the options are passed to
the diff command any way. So just drop it.

Reviewed By: DurhamG

Differential Revision: D8945812

fbshipit-source-id: 97eb2b1020c7ed8036a06a74f1bbb39bb545721b
2018-08-09 21:21:51 -07:00
Jun Wu
9b87af8c5e hgsubversion: use context manager for config override
Summary: To get rid of `ui.backupconfig`.

Reviewed By: DurhamG

Differential Revision: D8886274

fbshipit-source-id: cf8d5134f55725b3945370aeb148987332e48b2c
2018-08-09 21:21:50 -07:00
Jun Wu
1c4f6377fc hgsql: use with context for locking and config overrides
Summary:
Modernize the code to use `with` instead of `try`. The motivation is to get rid
of `ui.backupconfig`.

Reviewed By: DurhamG

Differential Revision: D8886249

fbshipit-source-id: 21591a2e74e61215b0b55a493a8c3b94a63ca5d9
2018-08-09 21:21:50 -07:00
Jun Wu
9740116626 lock: use flock on POSIX
Summary:
We recently ran into issues with locks in pid namespaces [1]. Let's fix that
by using flock.

flock is more reliable in Linux's pid namespace use-case than file-existence
test, because it works without a /proc filesystem and does not have deadlock
issue if an hg process is killed unexpectedly (ex. OOM or SIGKILL).

The transition should be transparent:
- If the new code saw a symlink lock file generated by the old code.
  `open(..., O_NOFOLLOW)` will fail and it's considered lock taken by the old
  process correctly.
- If the old code saw a new lock file. It will treat it as system without
  symlink support and it's considered lock taken by the new process correctly.

A non-symlink stale lock (regardless of whether it contains pid information or not)
will be confidently removed automatically by the new code.

The change is complicated because it works when both new and old hg
run at the same time. If we have migrated most users to the new code path,
the code can be cleaned up significantly.

[1]: https://fburl.com/85fxjisi

Reviewed By: DurhamG

Differential Revision: D9004614

fbshipit-source-id: d501c4f3a7bc8ad73c9556be1c6a265ffd0d0686
2018-08-08 16:20:21 -07:00
Liubov Dmitrieva
4ae5dcbac2 cloud join: remove unused param
Summary:
workspace is not needed for get bundles request
this is small clean up to remove unused parameter
it didn't cause any fails

Reviewed By: mitrandir77

Differential Revision: D9219599

fbshipit-source-id: d4018b2c345db2549f6edf9d29abc475d4c0ba57
2018-08-08 11:04:39 -07:00
Liubov Dmitrieva
1acaf11226 cloud smartlog: fix error with empty result
Summary: we crashed on empty result before this check

Reviewed By: markbt

Differential Revision: D9216307

fbshipit-source-id: 1f5ce5b0c783b25b45d51dbd3bb9f91a2eeee8b9
2018-08-08 06:24:31 -07:00
Durham Goode
e348c3c98c hggit: use transactions during git import
Summary:
Previously hggit used a single transaction for each commit it imported.
This added a lot of over head, such as writing the fncache every time and
committing to sql every time.

Instead, let's use a transaction that lasts a while. We'll tie it to the
existing gitmap save logic, so that we commit commits to disk before writing the
map file (so the map file never references commits that don't exist).

Reviewed By: quark-zju

Differential Revision: D9210162

fbshipit-source-id: 9b1302dfc824055742c4194dfaea7e172e5db6b4
2018-08-07 18:07:08 -07:00
Jun Wu
a95d4c0118 shallowbundle: fix parent dependency check during unbundling
Summary:
Apparently, the `continue` should apply to the `while` loop, not `for`.
This removes some random unnecessary SSH file fetches during unbundle.

Reviewed By: DurhamG

Differential Revision: D9174383

fbshipit-source-id: 9dad5c9e47d2d59fdc6421efd4bc303e791a6a9f
2018-08-06 23:05:28 -07:00
Jun Wu
394e0c8630 shallowbundle: break cycles when applying deltas
Summary:
There are 2 kinds of dependencies between nodes:

  1. Parents (or copyfrom parent).
  2. Delta-base.

Either of them cannot form cycles. But together they can. Previously they are
considered together, therefore infinite loops can occur. This patch removes
the dependency check for "delta-base" chains to solve the problem.

It hurts unbundle performance in theory as some deltas might be reapplied
multiple times. Practically, I guess nobody unbundles huge bundles in a
shallow repo, so it's probably fine.

Reviewed By: DurhamG

Differential Revision: D9174384

fbshipit-source-id: bbaaddaef4fce942337c64c5b72741eeff7a7a53
2018-08-06 23:05:27 -07:00
Jun Wu
4fb34160e2 shallowbundle: fix unbundle cycle detection
Summary: It was not effective because both `skipcount` and `len(queue)` grows unbounded.

Reviewed By: DurhamG

Differential Revision: D9173451

fbshipit-source-id: 3bb3597d7176ee3d0d6accca54c0db25ea7c83fa
2018-08-06 23:05:25 -07:00
Liubov Dmitrieva
c1967492ab commit cloud: fix cloud join command when no new heads
Summary:
We shouldn't send a get_bundles request with empty list of heads to the server.

It is waste of time for performance and also there is a bug to handle it on the server.

We build an incorrect mysql query.

I will fix it on server side as well.

Reviewed By: DurhamG, quark-zju

Differential Revision: D9184401

fbshipit-source-id: 24cf9db33f1faf5bf790f1d20766d250eb58b21b
2018-08-06 14:20:07 -07:00
Durham Goode
229cc3de75 treemanifest: add config option to bypass flat block
Summary:
A previous diff added a config option to block serving flat manifests.
We still need flat manifest serving for some of our mirroring infrastructure
(like git and svn mirroring), so let's add a bypass for those.

Reviewed By: quark-zju

Differential Revision: D9182861

fbshipit-source-id: 42d38000509c189dc5c85c5afeffe95f416726e3
2018-08-06 12:51:58 -07:00
Mark Thomas
a8d83ded88 rage: capture path by value for pack file listings
Summary:
Pack file listings are generated in a loop that creates lambdas.  Since python
lambdas capture by reference, they end up all using the same `path`.

A trick to avoid this is to pass the value as a default parameter to the
lambda.

Reviewed By: quark-zju

Differential Revision: D9154593

fbshipit-source-id: 4630bb590f6a7172cd850b2aa232848a6a5764d1
2018-08-03 19:05:20 -07:00
Liubov Dmitrieva
f97318d5b1 cloud join: don't repush commits known to be backed up
Summary: Speed up joining for users with many draft commits that have already been backed up by checking if their commits are already backed up.

Reviewed By: markbt

Differential Revision: D9065840

fbshipit-source-id: fcaf91b70cf6e0fc4c4bd747b0e44c37e50a3c86
2018-08-03 09:50:30 -07:00
Liubov Dmitrieva
7b92b09010 commitcloud: prototype for hg cloud sl command
Summary:
`hg cloud sl`
`hg cloud ssl`

is the future commands to look at somebody's else smartlog

trying to reuse defined ssl and sl templates

the only real place it uses changeling if hash shortening, so I have to use 'crop' instead

Reviewed By: quark-zju

Differential Revision: D8749430

fbshipit-source-id: e808623ad01d9a04681363bd2ca6d206da0ba1ce
2018-08-02 12:50:44 -07:00
Liubov Dmitrieva
f3937b3937 cloud join - add workspace parameter
Summary:
Add this as an experimental option

We don't have switching of workspaces so far, but hg clone is very fast with eden, so it is easy to create a brand new repo and join to any workspace.

This is already useful for debugging and repro user's issues.

You just join to the user's workspace from a brand new repo and can see what is going on there.

Reviewed By: quark-zju

Differential Revision: D9082157

fbshipit-source-id: 561314cddfced07c81c4bb6c1c2ccf99e140b27c
2018-08-02 05:20:28 -07:00
Jun Wu
d9496d4ad2 racedetector: ignore ignored files
Summary: Changing ignored files should be fine if "-i" is not passed.

Reviewed By: wez

Differential Revision: D9121707

fbshipit-source-id: d11f41cba9d25d8945dff052dd4075150c2b3bfe
2018-08-01 12:21:29 -07:00
Mark Thomas
7f7497d6c9 commitcloud: disambiguate usernames in default workspace names
Summary:
The default workspace name is `user/<shortname>/default`.  This is ambiguous,
as all of:
* fred.bloggs@example.com
* fred.smith@example.com
* fred@example.org
are rendered as `fred`.

This changes the default to use the full email, and provides a new config
option `commitcloud.email_domain`, which defines a single domain that is
dropped.

Reviewed By: liubov-dmitrieva

Differential Revision: D8998491

fbshipit-source-id: e108e116e82d3acc9f1ae1584c63266799fa8cc5
2018-08-01 08:02:35 -07:00
Jun Wu
d495c50cc6 hgsql: add a default-off config to bypass sync on non-root pid namespaces
Summary:
Previously, we patch all callers in a pid namespaces to bypass hgsql sync.
It's hard to verify that covers all cases. Therefore, change hgsql to do the
check instead.

Reviewed By: DurhamG

Differential Revision: D9092807

fbshipit-source-id: ccd7485f34e70e2efda9c77b3cf3be89925f80bf
2018-07-31 17:04:50 -07:00
Kaley Huang
6bbd9fbbe5 lfs: upload during push
Summary: during `hg push`, LFS blobs are not uploaded with bundles. this diff adds the extra step [`uploadblobsfromrevs`](https://fburl.com/v05o1l6l) to upload LFS blobs. infinite push [uses a similar approach](https://fburl.com/hwk8yyq4).

Reviewed By: quark-zju

Differential Revision: D9039657

fbshipit-source-id: 2b1651970df1d3761536ef6433d1362756ea3811
2018-07-31 14:50:15 -07:00
Durham Goode
9bfb2486a7 treemanifest: add treemanifest.blocksendflat config option
Summary:
In order to convert a server repo to treeonly mode, let's first add a
config option that will block even sending flat manifests from a server
repository. This will allow us to find clients who aren't using treeonly mode
before we stop producing flat manifests for good.

Reviewed By: quark-zju

Differential Revision: D9075308

fbshipit-source-id: 1bdce7b55ccb20c2c047939b89571b083d6fba8e
2018-07-31 10:23:21 -07:00
Durham Goode
7413a9e30e bundle2: use repo bundle2 capabilities when making local bundles
Summary:
In a future diff we'll need to read a repository's bundle2 capabilities
while creating a strip backup bundle. To do so, we need to pass the bundle2
capabilities to the strip backup bundle creation logic.

This may enable a bunch of features in strip backup bundles now, like newer
formats that were gated behind capabilities.

Reviewed By: quark-zju

Differential Revision: D9075304

fbshipit-source-id: 17109284d2cd81ae467474089c1438c11edcd085
2018-07-31 10:23:21 -07:00
Jun Wu
3043460653 blackbox: rotate automatically if it cannot be written
Summary:
I noticed many users have ".hg/blackbox.log" owned by root, which seemed to be
done by some less thoughtful automation. Blackbox became useless in that case.

This diff adds logic to rotate away those read-only files automatically.

Reviewed By: farnz

Differential Revision: D8974366

fbshipit-source-id: d63ff2ebdcfd5f85067e89b38b1ca174d0ea6f45
2018-07-30 09:19:58 -07:00
Jun Wu
4337aee636 mq: remove the extension
Summary:
mq is already somehow problematic at D8907646. Without bandwidth supporting
it, let's remove it.

Alternative to mq would be rebase, shelve, unshelve, histedit.

Maintain "--config extensions.mq=" compatibility by marking it builtin so hg4idea
won't break by this change.

Reviewed By: phillco

Differential Revision: D9039741

fbshipit-source-id: a3a1e48a2a982ff8e8b6a6ce659c906a4e2b2b36
2018-07-30 08:49:26 -07:00
Ryan McElroy
0a851d43ba dirsync: do not crash rebase when cwd goes missing
Summary: Replace an ugly hack with an less ugly hack for great winning

Reviewed By: quark-zju

Differential Revision: D9029088

fbshipit-source-id: 1cb4783fbe92ad122e540beb9e32caea0b418054
2018-07-30 08:05:07 -07:00
Jun Wu
ba0bb4495f pushrebase: use overlayfilectx
Summary: This allows pushrebase to avoid reading LFS content.

Reviewed By: DurhamG

Differential Revision: D8986782

fbshipit-source-id: 4ae6725d6fe901ec6b33d22d1f6c0f28c2ccfd39
2018-07-27 20:06:08 -07:00
Jun Wu
817968c8f8 histedit: use overlayfilectx
Summary:
Resend of https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-May/097695.html

Like the previous patch, this simplifies the code, and could make things faster
for mode-only changes.

Reviewed By: DurhamG

Differential Revision: D8986781

fbshipit-source-id: 993a97ade9a41627735a65919de9ab52b600a180
2018-07-27 20:06:07 -07:00
Durham Goode
a3ab094cbe treemanifest: prevent pushrebase from processing trees during reply
Summary:
In a previous diff we stopped pushrebase from sending flat manifests
back to treeonly client, but we didn't stop pushrebase from analyzing from
analyzing the manifests to decide what files to send. It turns out that this can
be expensive, since it needs to diff two manifests.

Let's fix up the bundle2 capabilities so that pushrebase knows to not send files
back to the client for a remotefilelog client.

Reviewed By: markbt

Differential Revision: D9021066

fbshipit-source-id: ba422ce8b5ada7905e4900ec68957a84613897ff
2018-07-27 10:36:23 -07:00
Mark Thomas
c933cc0459 rage: show most recent 100 obsmarkers
Summary:
`hg rage` attempts to find interesting obsmarkers related to the user's
smartlog.  This turns out to be very slow for users with lots of obsmarkers,
and generates very long rage output in this case.

Instead, just put the last 100 obsmarkers in the rage output.  If earlier
obsmarkers are needed, we can look for them separately.

Reviewed By: ryanmce

Differential Revision: D9027952

fbshipit-source-id: 0368d5e83bced77bb863d223927d614407f19fe1
2018-07-27 07:19:53 -07:00
Mark Thomas
0f6c096ef1 rage: add profiling of rage steps
Summary:
Some `hg rage` steps may be slow.  Add a profile so we can see which ones these
are.

Reviewed By: ryanmce

Differential Revision: D9027796

fbshipit-source-id: 6e478bee1f1265e4e80c067968da6821c7e071c9
2018-07-27 07:19:53 -07:00
Liubov Dmitrieva
f3c5a0b16a infinitepush: increase wait timeout
Summary:
our application code is setting the wait_timeout to 300s, this results in idle timeout for db query

this code path will be deprecated with Mononoke, so the simplest solution is to increase the timeout

Reviewed By: jrahman

Differential Revision: D8998850

fbshipit-source-id: 12ca2864874abfe2f7b8e7da0cd1309c927931f6
2018-07-27 04:19:19 -07:00
Durham Goode
7b92c91b98 repack: allow using rust datapacks during repack
Summary:
Now that rust datapacks implement markledger and cleanup, let's allow
using them during repacks.

Reviewed By: quark-zju

Differential Revision: D8895356

fbshipit-source-id: a5520316170b17ac14bf07de1f79143d3544b84a
2018-07-26 12:17:20 -07:00
Durham Goode
1d43f39db1 pyrevisionstore: implements Repackable APIs
Summary:
Adds the python shim layer for calling repack operations on rust data
packs.

Reviewed By: quark-zju

Differential Revision: D8895339

fbshipit-source-id: 6ce6835b21591200cd546b548ba169ddeb6020c4
2018-07-26 12:17:20 -07:00
Durham Goode
8f3b150224 pyrevisionstore: use pathencoding to handle byte conversion
Summary:
Let's use the pathencoding crate instead of a lossy conversion to
strings.

Reviewed By: quark-zju

Differential Revision: D8992738

fbshipit-source-id: 2975b421a3de5d7fafb6688260d9482af701092e
2018-07-26 12:17:18 -07:00
Durham Goode
e1b153825b revisionstore: store paths on DataPack object
Summary:
The paths for each data pack are used in various situations (repack,
error reporting, etc) so let's store them and make them accessible via the
python api.

Reviewed By: quark-zju

Differential Revision: D8884773

fbshipit-source-id: 4108c98b4e303ba9bded1f264746fa4a84845c73
2018-07-26 12:17:17 -07:00
Jun Wu
cd91de7c43 codemod: use byte strings in cython files
Summary:
For some reason, buck cython build starts to treat unprefixed strings as
unicode strings. That breaks Mercurial where everything should be bytes.

Therefore add the b prefix to make them byte strings explicitly.

Reviewed By: DurhamG, ryanmce

Differential Revision: D9015176

fbshipit-source-id: 7a3ef9d735362e3ae02208ec19d0551bf0adaaa4
2018-07-26 09:53:23 -07:00
Jun Wu
95eda34a4d debugshell: import more modules
Summary: This is handy.

Reviewed By: singhsrb

Differential Revision: D9006067

fbshipit-source-id: 79603c8b64b77bb808bb59ac14bfa4f24a03a7d7
2018-07-25 17:21:03 -07:00
Liubov Dmitrieva
db22476659 rage: correct user name for log paths, the username have to be the one from the machine
Summary:
shortuser is parsed from email address

for these 2 path of the disk we need to use util.getuser()

Reviewed By: singhsrb

Differential Revision: D8997967

fbshipit-source-id: cee983fe8ea19276e0b134f908af082cda7ed371
2018-07-25 14:50:57 -07:00
Durham Goode
458dd9e060 packs: move packpath and indexpath into functions
Summary:
A future diff will expose this data from the rust pack implementation,
so we need them to be expoed as functions instead of attributes.

Reviewed By: quark-zju

Differential Revision: D8884705

fbshipit-source-id: 401e5c0d24039c68063d4e9171fefefaf7c2bdff
2018-07-25 11:07:34 -07:00
Durham Goode
f00ef57f37 datapack: add option to enable using rust datapack
Summary:
Adds a config option that enables using rust data packs instead of
cdatapacks.

Reviewed By: quark-zju

Differential Revision: D8813134

fbshipit-source-id: c8948e2aef2486bf80d0306d89dd2ebc1b9fddcf
2018-07-25 11:07:34 -07:00
Durham Goode
2a037a6cc1 pyrevisionstore: convert getmissing to accept an iterator
Summary:
Previously it would only accept lists. This was fine for remotefilelog,
but treemanifest actually passes generators here, so we need to change this to
accept an iterator.

Reviewed By: quark-zju

Differential Revision: D8813143

fbshipit-source-id: 1d0cbf32d4c56521e26c55a6a061c22a1e618aed
2018-07-25 11:07:34 -07:00
Durham Goode
203e011368 repack: disable rust data packs during repack
Summary:
Rust pack files don't support repack yet, so let's disable them during
that. This requires rebuilding the stores, so we added the ability to invalidate
the stores during a repo invalidate (which arguably should've been there in
the first place).

A future diff actually adds this config option.

Reviewed By: quark-zju

Differential Revision: D8813132

fbshipit-source-id: d1d5f30ff2708b6686ed8d491d49558b3dde8314
2018-07-25 11:07:33 -07:00
Durham Goode
7241c3d13f pyrevisionstore: convert errors into the appropriate python errors
Summary:
Previously we converted all rust errors into python KeyErrors. Let's
cast KeyErrors into python KeyErrors and everything else into RuntimeErrors for
now. We can expand this as needed.

Reviewed By: farnz

Differential Revision: D8775753

fbshipit-source-id: f72e96db752167110d989226f2dedb9ff5bd82a3
2018-07-25 11:07:32 -07:00
Durham Goode
82a6a73b98 datastore: add get_delta function to DataStore trait
Summary:
This function is present on the python data store api, so let's
replicate it here. Later we should come back and refactor this to be a special
case of the get_delta_chain result, but for now we'll maintain the custom API so
we can start using this code from python.

Reviewed By: quark-zju

Differential Revision: D8774474

fbshipit-source-id: aabcff3a43ae68859a1bf3b23f433214571b1a9d
2018-07-25 11:07:32 -07:00
Jun Wu
153b5ee7b0 clindex: disable conflicting features
Summary:
When investigating https://fburl.com/h4qw0060, I noticed `clindex`'s
partialmatch took 10ms per lookup. Looking at clindex code, it maintains two
indexes - one powered by the Rust radixbuf, and another normal Python dict for
"overrides".

When the "overrides" get big enough, "partialmatch" would be slow because it
has O(overrides) complexity. And perftweaks' "cachenoderevs" feature will
call "index.__setitem__" which populates the "overrides" dict.

D8626199 was an attempt to fix perftweaks. But it uses a wrong condition:

  if not (ui.config("extensions", "clindex") or "!").startswith("!")

should be:

  if not ui.config("extensions", "clindex", "!").startswith("!")

This patch should fix it. As we're here, also disable fastpartialmatch
explicitly if clindex is enabled.

In the future, indexedlog would solve this cleanly - "overrides" would be
part of the real index that supports efficient prefix lookup, instead of a
Python dict.

Reviewed By: ryanmce

Differential Revision: D8985248

fbshipit-source-id: 676863cb33b1ee974c47c243c5eca4c9c19174be
2018-07-25 08:34:55 -07:00
Stanislau Hlebik
def2302abb pushrebase: record duration as well
Summary: Useful to compare perf

Reviewed By: quark-zju

Differential Revision: D8932499

fbshipit-source-id: 4624222db49f95cdcbb347ffa4eade10f9128225
2018-07-25 02:34:49 -07:00
Kaley Huang
813ff213e6 pushrebase: add a test with lfs enabled
Summary:
enables lfs for pushrebase and adds tests.

using
```
  > [pushrebase]
  > rewritedates = True
```
in the tests so that pushrebase actually changes the hash of the commit

Reviewed By: DurhamG

Differential Revision: D8939281

fbshipit-source-id: a3b95962635bb1f7926889c2869ea79cfca8132d
2018-07-24 09:32:02 -07:00
Adam Simpkins
49b000422f fix bug in py-cstore code deleting unallocated memory
Summary:
Fix subtreeiter_create() to avoid calling the `SubtreeIterator` destructor on
an object that it never constructed.

If an error is thrown constructing the `cmpNodes` vector or calling the
`SubtreeIterator` constructor, then the `SubtreeIterator` destructor should
not be called.  However, the `subtreeiter_create()` previously used
`Py_DECREF` to clean up the object, which always invoked
`subtreeiter_dealloc()` and called the `SubtreeIterator` destructor.

It looks like a lot of the other python object types declared in this file
have similar problems, and may incorrectly invoke C++ destructors on objects
that were never constructed if something goes wrong during object
initialization.  I have not fixed the other types yet as part of this diff.
The initialization logic for each type looks somewhat different, so they will
each need different fixes rather than this simple change of just calling
`PyObject_Del()` rather than `Py_DECREF()`.

Reviewed By: quark-zju

Differential Revision: D8963858

fbshipit-source-id: d610cac16133a7ff2350c17b13b5ebc7b7becc29
2018-07-24 09:32:02 -07:00
Stanislau Hlebik
a74f53c7ea disable fastheaddiscovery during push
Summary:
fastheaddiscovery is a remotenames feature which makes discovery faster but
less precises. For example, it can request more commits from the server than
necessary. That's not a big deal during pulls, but it can be a problem during
push. It may try to push public commits to the server. People can ran into this
behaviour when they pull commit cloud commit from another devserver and this
commit is based on a newer public commit.

Reviewed By: quark-zju

Differential Revision: D8931322

fbshipit-source-id: 03c6f1df23c3742bda12adf40bf477711f7835bb
2018-07-24 00:35:44 -07:00
Saurabh Singh
c5a2f465ca globalrevs: support global revs for commits created using hgsubversion
Summary:
This commit enables embedding global revisions in commits created via
the `hgsubversion` extension.

Reviewed By: quark-zju

Differential Revision: D8925897

fbshipit-source-id: 17f320dd7b6ca560acb78ba8e5ee26a8a3a6b045
2018-07-23 18:53:16 -07:00
Durham Goode
7386791327 pushrebase: don't send flat manifests back during reply to treeonly
Summary:
When constructing the pushrebase reply part, we weren't passing the
bundlecaps along, so it was creating a normal flat-manifest changegroup. A
treeonly client that received this would have to translate it to a tree, which
was expensive for pushes that returned a lot of manifests.

The fix is to pass the appopriate bundle caps to the changegroup creation. Since
we don't have access to the bundle1 caps inside a bundle2 part handler, we had
to update the treeonly logic to also pass treeonly=True caps as bundle2 caps.

Reviewed By: StanislavGlebik

Differential Revision: D8958866

fbshipit-source-id: 4d68031aedb61ae4b113ea9376c704c7548f029c
2018-07-23 18:53:13 -07:00
Jun Wu
f3e69ec61a bugzilla: drop the extension
Summary:
It's similar to acl and notify - not used and can be done using hooks
externally.

Note the bugzilla extension actually works with the Rust config parser,
unlike acl and notify.

Reviewed By: DurhamG

Differential Revision: D8953126

fbshipit-source-id: 43b12666e4d9c03f800395613eed06783aac48b3
2018-07-23 18:37:10 -07:00
Jun Wu
95dbb0bca1 notify: drop the extension
Summary:
Similar to the acl extension, notify is not used here and can be implemented
as hooks.

The direct motivation is, it uses weird key in config names that get rejected
by the Rust config parser:

```
  hg: parse error: ".../.hgrc":
    --> 61:4
     |
  61 | */a#branch(test) = will_no_be_send@example.com
     |    ^---
     |
     = expected equal_sign
```

Although the pest syntax can be updated to support this case, by using
different `name`s for sections, and config names. It seems cleaner to
just drop notify, as it's the only trouble maker.

Reviewed By: DurhamG

Differential Revision: D8953127

fbshipit-source-id: fc7760a32b6ea538cb207c860aadac7b4b58027f
2018-07-23 18:37:10 -07:00
Jun Wu
eb67457eba acl: drop the extension
Summary:
It's rarely used here and feels like a burdern to continue support.

It only restricts write access. A well-designed commit hook API should be the
superior solution here.

The direct motivation of the removal is becuase it does not work well with the
Rust config parser. Namely it's the unique extension that treats an empty
section differently from an section that isn't set. That does not play well
with the Rust config parser. While it can be worked around like D8887670, it's
not a very clean soution, and there are other issues making test-acl.t fail.

Therefore, instead of trying to find the remaining weirdness of acl, I figured
it's probably the right call to drop it and redirect users to hooks instead.

Reviewed By: DurhamG

Differential Revision: D8953125

fbshipit-source-id: 209f04423ccdf182b0ba4021b59d26525173d73c
2018-07-23 18:37:10 -07:00
Liubov Dmitrieva
f1244a0726 Fix uncatched error with long stack on socket timeout
Summary: Provide better user experience when vpn is off

Reviewed By: quark-zju

Differential Revision: D8950997

fbshipit-source-id: 50db83c1ac3ee11045ecb64e6d8425cb821a0650
2018-07-23 16:50:43 -07:00
Saurabh Singh
d2c0a06655 sqlrefill: fix bug leading to failure of commits after sqlrefill
Summary:
`test-hgsql-sqlrefill.t` exposes an issue which leads to the
repository ending up in an uncommittable state. This commit fixes that issue by
adding the expected data to the database.

Reviewed By: quark-zju

Differential Revision: D8925906

fbshipit-source-id: 1e0ec827df6e755f72575b03f094b0ca5a400e9b
2018-07-23 12:59:04 -07:00
Saurabh Singh
a12fedd9e6 sqlrefill: fix issue with heads not being in sync after sqlrefill
Summary:
`test-hgsql-sqlrefill.t` exposed an issue with `sqlrefill` where the
database is inconsistent with the state of the repository if the repository had
no data in the database before the invocation of `sqlrefill`. This commit fixes
that issue by also updating the `revision_references` table in this case.

Reviewed By: quark-zju

Differential Revision: D8925895

fbshipit-source-id: ca94ba1b3bd168128edc0c845b2fc1439c15181c
2018-07-23 12:59:02 -07:00
Saurabh Singh
60bd8762b5 hgsql: refactor to segregate the updates to the database during commit
Summary:
We update two different schemas in the database during the commit and
it makes sense to isolate this logic in a method. As part of this refactor, we
are also removing `_validatependingrevs` dependency on `self.pendingrevs` which
needlessly restricted the scope of the method.

Reviewed By: quark-zju

Differential Revision: D8925905

fbshipit-source-id: 612c908f39f0902784c1807bed01caa0cd67fa53
2018-07-23 12:59:00 -07:00
Saurabh Singh
e34c0073fd hgsql: respect --cwd global option in commands
Summary:
`sqlrecover`, `sqlrefill` and `sqlstrip` use `ui.environ["PWD"]` to
get the current working directory which leads to not respecting the global
`--cwd` option to the Mercurial commands. This commit switches to using
`pycompat.getcwd()` instead which fixes this issue.

Reviewed By: quark-zju

Differential Revision: D8925908

fbshipit-source-id: 743bf3f6dda0a8545b171b01c1f7d3288f2936b7
2018-07-23 12:59:00 -07:00
Saurabh Singh
6abe49da8c globalrevs: allow making commits without using pushrebase
Summary:
As an intermediate step in conversion of the `WWW` repository to being
an Mercurial only repository, we will be modifying the `hgsubversion` extension
to start supporting `globalrev` in the commits pulled from the source
Subversion repository.

The `globalrevs` extension needs to allow for creation of commit through means
other than pushrebase for this process to succeed. Therefore, let's introduce a
configuration option for this purpose.

Reviewed By: quark-zju

Differential Revision: D8925894

fbshipit-source-id: ecb253828c0801c1c39f57ccaf2e11992a924e63
2018-07-23 12:58:58 -07:00
Saurabh Singh
b8c1e8b8eb globalrevs: use configitem for configuration defaults.
Summary:
This commit just uses the `configitem` to specify the default for the
configurations items relating to `globalrevs` extension.

Reviewed By: quark-zju

Differential Revision: D8925901

fbshipit-source-id: 6d4cf10a2e623b94d3a94eeb1f411d784374a4d5
2018-07-23 12:58:57 -07:00
Saurabh Singh
b5146cfbfe globalrevs: only wrap pushrebase commit logic if repository is on server
Summary:
Rather than having a comment which specifies that this code path won't
be hit on the client, it's probably better to only execute the new code if the
repository is on the server.

Reviewed By: quark-zju

Differential Revision: D8925902

fbshipit-source-id: 9404ad9e33f95f580d04d5aa3d40225ecc1dc7b4
2018-07-23 12:58:56 -07:00
Phil Cohen
33eb36affa rebase: improve the IMM working copy check
Summary:
I noticed when `amend --rebase`ing that rebase was refusing to run because my working copy was dirty. That shouldn't happen with `amend --rebase` because the working copy won't move.

I realized you can pass revisions in the rebaseset that won't be rebased, which is what was happening here. So, let's move this check to look at the generated `destmap`, which is the definitive source of truth for what will move.

Reviewed By: quark-zju

Differential Revision: D8921695

fbshipit-source-id: 292e8d14342adf70a4f693d91a9a3f2aad4f2ff9
2018-07-23 12:35:23 -07:00
Liubov Dmitrieva
a1c084cc22 commitcloud: show spinner while waiting on background command to complete
Summary: make ux better when waiting for background cloud sync to complete by showing progress bar

Reviewed By: quark-zju

Differential Revision: D8735116

fbshipit-source-id: 94659422a6fb16e540964c8b5f3316b1bb0a837f
2018-07-23 04:05:04 -07:00
Phil Cohen
758d99f8d5 fbamend: add the ability for amends to automatically restack if there won't be conflicts
Summary:
This uses the --noconflict flag added in the previous diff to make auto-restacking, as long as there aren't conflicts or a mergedriver run, trivial.

It creates the `amend.autorestack` flag with four options:

- `never`: never attempt to restack.
- `only-trivial`: restack only if the manifest is unchanged (the old behavior). We can remove this after the rollout.
- `no-conflict`: restack if there won't be merge conflicts.
- `always`: always attempt to restack.

Reviewed By: DurhamG

Differential Revision: D8721726

fbshipit-source-id: 620c08f6082033272dde35cb27b199615f16a787
2018-07-19 16:06:25 -07:00
Stanislau Hlebik
9bbed0d0d1 remotenames: record many journal entries at once
Summary:
If pulling or pushing to a new remote server, remotenames may call
`journal.record()` many times. Internally it does a few filesystem seek, and it
can be slow. With `recordmany()` we will pay the cost of seeks ony once.

Reviewed By: quark-zju

Differential Revision: D8873998

fbshipit-source-id: 385542bae7f210eb4f0bba3a02a13e7a4ce76d1d
2018-07-19 00:35:02 -07:00
Jacob Bower
d31d953b2a Fix incorrect base-rev and file lists in hg diff --since-last-submit-2o
Summary:
When creating the two first-order diffs we are currently diffing the two revs to the parent of rev1. This was something I was playing around with before but actually doesn't make sense. This returns things to diffing rev1 to rev1's parent and rev2 to rev2's parent.

I think the problem I was trying to work around was seeing files appearing to be changed not to do with either rev1 or rev2. The correct fix for this is to only consider files which are in rev1 or rev2.

Reviewed By: quark-zju

Differential Revision: D8904312

fbshipit-source-id: f48bd498cc27ea650a859d7b318f32520f946150
2018-07-18 17:12:13 -07:00
Phil Cohen
4cebb13c1a rebase: fix fallback if merge.update leaves files unresolved, but doesn't raise InMemoryMergeConflictsError
Summary:
As written, merge tools and drivers are responsible for raising `InMemoryMergeConflictsError` themselves. We shouldn't finish merge.update with unresolved files under IMM.

However, we had this fallback in case we missed a spot, and it turns out there was such a spot: D8886237.

D8699551's addition of required parameters to the constructor broke this fallback. So, this adds the parameters back in.

Reviewed By: quark-zju

Differential Revision: D8886238

fbshipit-source-id: 111fcce6a5a38d126c0118208e508c04b7566971
2018-07-18 13:06:15 -07:00
Durham Goode
143e925e07 treemanifest: increase revlog lru cache from 15 to 100
Summary:
This lru cache keeps recently accessed revlogs in memory for fast
access. Originally we had it set to 15 since we estimated that would likely be
longer than most directory paths. It turns out this causes significant slow
downs in some of our mirroring jobs because big revlogs, like the root tree, may
be discarded from the lrucache.

So let's crank this up to 100. This should still bound memory nicely, while
giving us better cache hit rates.

Reviewed By: quark-zju

Differential Revision: D8879648

fbshipit-source-id: d7b6e4244a6e403b7299b61de5d469004667497c
2018-07-18 10:21:09 -07:00
Durham Goode
39c3ffbbc5 datapack: add python datapack wrapper
Summary:
Now that all the business logic is reusable, let's create a python
datapack wrapper. In a future diff we'll allow Mercurial to instantiate this
instead of the existing cdatapack and datapack classes.

Reviewed By: quark-zju

Differential Revision: D8774486

fbshipit-source-id: 0df8ec0cc4ae7ebfc380c496b85555c78d5da505
2018-07-17 15:10:01 -07:00
Durham Goode
260e22ee9d pyrevisionstore: move python data store logic to DataStorePyExt trait
Summary:
In a future diff we'll be add a python datapack wrapper, in addition to
the existing datastore wrapper. The logic inside them is basically identical, so
let's move all the existing logic out to a trait that can wrap all DataStore implementations.

Reviewed By: quark-zju

Differential Revision: D8774257

fbshipit-source-id: ecb9a5d174decb803c1b1216db2d366b5215ab89
2018-07-17 15:10:01 -07:00
Jun Wu
01fc38d9d4 sparse: do not load dirstate in reposetup
Summary:
While investigating T30931730, I wondered why Eden importer needs to access
dirstate. Turned out the sparse extension would construct it in `reposetup`.
Changing that to a cheaper test - `repo.local()` to avoid loading dirstate.
A local repo always has a dirstate.

Reviewed By: simpkins

Differential Revision: D8669930

fbshipit-source-id: b738f7d888fe8ad62c9a29bd910230f62278a7af
2018-07-17 14:50:24 -07:00
Stanislau Hlebik
300e18df08 commit cloud: replace default path when pulling from Mononoke
Summary:
To make Mononoke dogfoodable, we need to add this change.
In D8734958 I've added force pulling from `infinitepush` path in some cases
(i.e. when user does `hg pull -r HASH`)

However that's not enough. Changing the path to `infinitepush` results in
remotenames adding lots of new bookmarks to `.hg/remotenames` file like
`infinitepush/master`, `infinitepush/stable` and so on. First of all, that means that
they will show up in smartlog and make it more cluttered. Secondly, and more
importantly, it will result in adding lots of bookmarks to the repo.journal -
https://fburl.com/80hy1rv5 . Turns out, that can be very slow.

Reviewed By: farnz

Differential Revision: D8859001

fbshipit-source-id: 973c0ab13563a7010077fdb016f43106b1fba744
2018-07-17 02:05:24 -07:00
Jacob Bower
21b2a6e47f Add second-order diff display for changes since last Phabricator upload
Summary:
The `arcdiff` hg extension is useful in concept - showing the changes since last Phabricator upload, but in practice there is usually too much noise in the output from rebasing. For example, consider the case where I have a stack and haven't re-uploaded the current commit. If one of the ancestors in the stack has changed and I use `--changes-since-last-arc-diff` I end up seeing those changes mixed plus the changes to the the ancestor.

Here we introduce a feature to show only a diff of the current commit vs. Phabriactor's version of the commit i.e. a diff of a diff, or "second-order" diff. The goal is not to perfectly reconstruct the changes, just to highlight what changed for human consumption. There are no line-ranges or context in the diff output, but it still seems pretty usable.

This new feature is invoked via the option `--changes-since-last-arc-diff-2o` to `hg diff`.

Reviewed By: quark-zju

Differential Revision: D8787504

fbshipit-source-id: 2885a118a712a3d9187e6fce67a465e7b664c3ca
2018-07-16 17:51:49 -07:00
Jacob Bower
0ae447b22c Deprecate --since-last-arc-diff
Summary: --since-last-submit is the new hotness

Reviewed By: quark-zju

Differential Revision: D8851071

fbshipit-source-id: 3cc7a9b9c32631bc507fb3bee74db7e5ae95f802
2018-07-16 17:51:49 -07:00
Durham Goode
5849411988 fastmanifest: switch to using manifestlog.ui where possible
Summary:
Previously, the fastmanifest factory class kept a copy of the initial ui object
from uisetup(). This meant it executed all things using the configuration of the
first repository. In a command that opens many repositories, like hg pull or hg
gc, this caused it to use the wrong configuration.

To fix this, let's switch as much of the fastmanifest factory to use
manifestlog.ui (which is the repo specific ui) instead of self.ui. We can't get
rid of self.ui just yet, since it's still required for the revlog.add()
override, but this fixes the hg gc breakage. We should fix the revlog.add case
later too.

Reviewed By: quark-zju

Differential Revision: D8840003

fbshipit-source-id: 037dcf98422826a0223a9941c2a5931b7408b2a5
2018-07-15 10:03:33 -07:00
Jun Wu
27c4c8c207 test-hgignore: use treestate
Summary:
Running this test with watchman exposes an issue in fsmonitor where ignore
rules are not respected for autditpass files. Therefore an ignore check was
added.

Reviewed By: phillco

Differential Revision: D8842387

fbshipit-source-id: 16fa8776eb4a36b07c1ddbc7b96ef6eddf9d7ae8
2018-07-13 19:05:54 -07:00
Stanislau Hlebik
1b2b294b18 pushrebase: add recording requests
Summary:
If pushrebase.enablerecording and the rest of the parameters are set then let's
save pushrebase requests. It involves saving the changegroup and treemanifest
bundles2 parts to bundlestore, and then inserting an entry into the database

Reviewed By: quark-zju

Differential Revision: D8801602

fbshipit-source-id: bea4f798daa8542541c8d7c4c2a051c8583930a0
2018-07-13 09:36:52 -07:00
Stanislau Hlebik
e3c0c7ab65 mysqlutil: new utility for mysql
Summary:
Common library to interact with mysql. Will be used in the next diffs to record
pushrebase requests

Reviewed By: quark-zju

Differential Revision: D8801603

fbshipit-source-id: 1a926742cc40458e8f9da385620f0f3837f3ae09
2018-07-13 09:36:52 -07:00
Stanislau Hlebik
60e10ef772 pushrebase: add ConflictsError
Summary:
For request recording we want to treat conflicts separately. Let's add a
special exception for that.

Reviewed By: quark-zju

Differential Revision: D8787567

fbshipit-source-id: 8bee7e1a61763982e74fbaf15a9320d1d565fd76
2018-07-13 09:36:52 -07:00
Stanislau Hlebik
74b93af7fe pushrebase: move to a separate package
Summary:
The file is already quite big, and I'm going to add request recording
functionality soon. Let's move it in a separate package

Reviewed By: quark-zju

Differential Revision: D8787566

fbshipit-source-id: c0202d2ebf1e1662d4b02b966035f6cce9d2344e
2018-07-13 09:36:52 -07:00
Hugh Harris
259d2f767b Bootcamp: store secret tokens for Commit Cloud in keychain
Summary: Add config option to store commit cloud tokens in keychain using secrets_tool.

Reviewed By: liubov-dmitrieva

Differential Revision: D8755371

fbshipit-source-id: 08a0f531343f4366beaad0197568ab16c10f9e2c
2018-07-12 08:49:59 -07:00
Phil Cohen
916bcca9e2 sampling: add support for environment variables to be logged as metrics
Summary: It seems likely that we'll want to capture environmental vars and log them. Let's make this really easy to do by parsing a config list.

Reviewed By: quark-zju

Differential Revision: D8810693

fbshipit-source-id: 25f507323e3fc4b8c666c66429001189ad7dc7ef
2018-07-11 21:09:32 -07:00
Phil Cohen
fd08af52da sampling: fix sampling for keys starting with e, k, y
Summary:
`lstrip` removes *all* of the characters in the given set from the beginning of the string. It doesn't just remove the given prefix, which I think was the intention.

So if you specified `key.env_vars=...`, `key.e` would be stripped, not just `key.`, and `nv_vars` would be set instead of `env_vars`

Reviewed By: quark-zju

Differential Revision: D8810694

fbshipit-source-id: 5f93bd9bdb660430c59ed7ae7e6ff7a7edcf4764
2018-07-11 21:09:31 -07:00
Liubov Dmitrieva
0a30686835 rage: fix check code
Summary: fix code style

Reviewed By: DurhamG

Differential Revision: D8809374

fbshipit-source-id: e4eea7ff02c0c37a6faf2d7830d6a63b04722544
2018-07-11 13:06:51 -07:00
Liubov Dmitrieva
9c359b4176 rage: do not return obsmarkers from deep history
Summary:
hg debugobsolete section of hg rage: skip very old data

it will help users with old repos like this:

P59801250

from 2015

I am worried that after that diff it seems to be impossible to know the repo age but we should provide it in another way

Reviewed By: DurhamG

Differential Revision: D8787883

fbshipit-source-id: eb8be28a87449006846eb985a98de6f85a0b5e63
2018-07-11 07:07:37 -07:00
Alexandre Marin
d364fba4bf p4syncimport - make it case insensitive to resist perforce casing
Summary: Makes syncimporter case insensitive for p4 paths to properly handle Perforce's case insensitivity.

Reviewed By: zhh95

Differential Revision: D8777555

fbshipit-source-id: 8d39f2455f42b27a3a3341c02901ed31398cc5bd
2018-07-10 11:35:47 -07:00
Durham Goode
2b227c6f43 datapack: change datapack.path to datapack.path()
Summary:
Previously, callers could access the datapack's path via the 'path'
field. In the rust implementation fields won't be accessible, so let's change
this to an accessor function instead.

Reviewed By: singhsrb

Differential Revision: D8773923

fbshipit-source-id: faea2f99e2dff99f3b6300f575bb9ff2ac178a11
2018-07-09 18:02:58 -07:00
Durham Goode
1ba7bce984 pyrevisionstore: fix delta chain base case name
Summary:
A recent change made delta base's be Option types, and when we
encounter a None we treat that as the end of a delta chain. In the python
translation layer code we turned this into a Key of ("", nullid) when it
should've been (filename, nullid). This broke a test.

Reviewed By: phillco, quark-zju

Differential Revision: D8768592

fbshipit-source-id: 858a8eadad8699d2e7e99040486f836710381a4f
2018-07-09 10:14:15 -07:00
Phil Cohen
9c41cf636e merge: add number of mergedriver-resolved files as a metric
Summary: This is useful to split dev_command_timer rows based on how many files were rebuilt.

Reviewed By: DurhamG, singhsrb

Differential Revision: D8737307

fbshipit-source-id: 18d52c0fd13184d789daaa8a74f85360554da703
2018-07-06 20:14:28 -07:00
Wez Furlong
70cdd4a413 make hg grep aware of big grep
Summary:
This isn't 100% finished and is missing handling some
error cases, but I wanted to put it out there to get some knee-jerk
reactions and suggestions on how to handle some things.

This diff adds a `grep.usebiggrep` config option to `hg grep`.  The idea is
that we'll default this to on when the repo requires `eden` (or when we pull in
the eden specific site configuration).  When run in big-grep mode, we'll first
ask big grep for the results and then compute the local differences and run
only those through the local grep process, and avoid materializing files
locally.

I'm not 100% sure if the current `repo.status` call will yield the correct
results for the case where the current rev is behind the biggrep
corpus revision.

Reviewed By: quark-zju

Differential Revision: D8416360

fbshipit-source-id: 952badb7a7ec74096b5c77cd79aa25e2327a7659
2018-07-06 20:14:28 -07:00
Jun Wu
8fc182554c treedirstate: avoid calling None.clear in clear()
Summary:
Treedirstate could have `None` _nonnormalset or _otherparentset. Check them
before calling `.clear()`.

Reviewed By: markbt

Differential Revision: D8752216

fbshipit-source-id: 7c72e3a31a405ee2b0464ea08d93b8dd3a187597
2018-07-06 19:20:24 -07:00
Durham Goode
97ad2b1c85 pyrevisionstore: fix build breakage
Summary:
The recent change from delta.base being a Key to an Option<Key> needed
to update pyrevisionstore as well. I'll add this to buck build soon so we can
catch this.

Reviewed By: phillco, quark-zju

Differential Revision: D8752910

fbshipit-source-id: ecf6d2a8a74b72d10b6dc0fb24c7b9346f0f7ed8
2018-07-06 16:06:25 -07:00
Jun Wu
578077cc98 hggit: drop gitignore support
Summary:
The gitignore implementation in core is more complete (support "!" rules)
and efficient (in native Rust). So let's drop the gitignore support in
hggit.

Reviewed By: singhsrb

Differential Revision: D8744807

fbshipit-source-id: faecace0ab0d5a0e015f50473dd1e0c232d013ff
2018-07-06 10:36:17 -07:00
Stanislau Hlebik
4f70dea422 prefer 'infinitepush' path instead of 'default'
Reviewed By: markbt

Differential Revision: D8734958

fbshipit-source-id: 7ed7910befdbd7081af645c0bd89927a9f0c0ce4
2018-07-06 08:12:28 -07:00
Liubov Dmitrieva
b159ed37b8 commitcloud: advertise Cloud Sync when user uses short hashes and also updates to own commit
Summary:
Currently many users use hg up to move own commits between the repos because unaware about cloud sync.
The hint will be shown on ambiguous prefix only, so it will not distract anyone.

Reviewed By: markbt

Differential Revision: D8732276

fbshipit-source-id: ae8fa10b28873134da013bc56ff9ebc33e9ed303
2018-07-06 07:05:47 -07:00