Commit Graph

801 Commits

Author SHA1 Message Date
Aleksei Kulikov
3c5be085f0 snapshot: remove the debug commands
Summary: They became redundant and impose restrictions on the code.

Reviewed By: quark-zju

Differential Revision: D17463968

fbshipit-source-id: 83cb8d9dca037747e62f9e8c41a4081259c92e91
2019-09-21 14:17:05 -07:00
Aleksei Kulikov
23d65a01d5 snapshot: refactor the metadata class
Summary: Do not keep a reference to the repo and provide a better API.

Reviewed By: quark-zju

Differential Revision: D17463871

fbshipit-source-id: d54256208b5f571ca8a4f4e2d07353edd9e825b2
2019-09-21 14:17:05 -07:00
Jun Wu
35e4fd4089 sampling: add a debug option
Summary:
This config prints out data written by the sampling extension.

The motivation behind this is, we want the Rust code to also be able to
generate data that can be sent to our remote logging infra (scuba).
Right now, the only way to do that is to go through sampling.py, and
use the `ui.log` API. I'm looking to change it to use Rust code and
blackbox data instead. To get some confidence about the upcoming Rust
code, I need a way to easily compare data using production setup.

Reviewed By: singhsrb

Differential Revision: D17494927

fbshipit-source-id: 0b10562925ec82dbd67f18996d7bfeab8cfd81ee
2019-09-20 18:32:38 -07:00
Jun Wu
484939a75d hgmain: make bindings a builtin module
Summary:
Global states (For example, the global blackbox instance, potentially some
logging / tracing libraries) are separate in the Rust and Python worlds.

That is because related code gets compiled separately:

  bindings.so (top-level)
   \_ blackbox

  hgmain (top-level)
   \_ blackbox (have a different global instance than the above blackbox)

To address it, make `bindings` a builtin module in `hgmain`.

The builtin module was renamed from `edenscmnative.bindings` to `bindings` so
it does not require importing anything else (For example, `edenscmnative`).

This unfortunately makes `hg` 100+ MB. Fortunately it can be compressed well
(gzip: 31MB).

Reviewed By: singhsrb

Differential Revision: D17429688

fbshipit-source-id: bf16910d7a260ca58db0d272fc95d8071d47bbc6
2019-09-20 18:32:36 -07:00
Durham Goode
a0a2518bf6 hgsubversion: skip empty commits when pushing
Summary:
We're down to just one use of hgsubversion. In that use it's convienent
to skip empty commits when pushing. Let's add logic to bypass empty commits.

Differential Revision: D17452527

fbshipit-source-id: 5ef76df7d0a44f2d43f4ea0d8678e4174c0286ee
2019-09-19 15:44:19 -07:00
Thomas Orozco
38e82ab70c lfs: log lfs_url
Summary:
This adds the `lfs_url` to our logs, which makes it easier to identify the
vip we're trying to talk to, and will make it easier to monitor for errors if
any come up.

Reviewed By: HarveyHunt

Differential Revision: D17474943

fbshipit-source-id: 5f67665cffa878966e5d49fae672ff1be571690e
2019-09-19 05:16:32 -07:00
Jun Wu
b737973619 merge: make it possible to manually specify a rename destination
Summary:
When the rebase destination has renamed a file, and copytrace failed to figure
out anything useful, make it possible to manually input the rename destination.

I'm using it to resolve conflicts caused by landing the bindings rename.

Reviewed By: xavierd

Differential Revision: D17367857

fbshipit-source-id: 55d9ed3a9641e40cc43518e9662fd803cbc00620
2019-09-18 20:44:05 -07:00
Xavier Deguillard
a55686ab8e remotefilelog: split remotefilelog.cacheprocess config option
Summary:
The cacheprocess config is of the form: memcache_client key. With the memcache
client moving in process, the memcache_client binary is not of interest, but
the key is.

Reviewed By: quark-zju

Differential Revision: D17438697

fbshipit-source-id: 925c6e4c390f975825afef01fbd87a9331894e81
2019-09-18 08:57:03 -07:00
Jun Wu
a0ede6c4c6 progressfile: include pid in progress information
Summary:
This provides a way to check if the hg process was gone unexpectedly.
The motivation was to make it less likely that Nuclide shows an hg operation
was ongoing but the process was long gone.

Reviewed By: xavierd

Differential Revision: D17372808

fbshipit-source-id: 19e51f8bbd0fdf14b7e0a4bdb8247d1b4277ee48
2019-09-16 19:02:38 -07:00
Jun Wu
bbd4b91102 remotenames: move 'remotenames' state to storevfs
Summary:
In the future the changelog would need to access 'remotenames' to figure out
public heads. Move the state file to svfs so it can be read by the changelog
object, which only has access to svfs.

Reviewed By: sfilipco

Differential Revision: D17199834

fbshipit-source-id: 9000e0d8e8bb8d398d6c77b5b395da904fef6418
2019-09-13 20:19:09 -07:00
Xavier Deguillard
69d76149d2 remotefilelog: add the indexedlog to remotefilelog.shareddatastores
Summary:
Ondemand has been complaining that their hgcache was growing very quickly, and
looking at logs and scuba data, this appears to be caused by refetching
everything from the network and writing it to the indexedlogdatastore.

Looking at the prefetch code, I realized that the indexedlogdatastore wasn't
present in the repo.fileslogs.shareddatastore list, and therefore may be
omitted from the stores in which we look for data.

Reviewed By: kulshrax

Differential Revision: D17374761

fbshipit-source-id: 9e9f279d4c8154e2491312a57d24bc5fd7da79fc
2019-09-13 15:29:40 -07:00
Jun Wu
14d1ae5689 amend: do not rebase obsoleted commits for next --rebase
Summary:
I hit this when editing the dag stack. This resolves a "BUG" in the
test-amend-nextrebase.t test.

Reviewed By: singhsrb

Differential Revision: D17357387

fbshipit-source-id: 309efe34dee71180abdbdb5a9fe2e7b731230051
2019-09-12 20:00:28 -07:00
Arun Kulshreshtha
980bcdd0f8 manifest: add bfs diff to bindings crate
Summary: Add support for calling the new BFS diff implementation from Python. This diff adds the appropriate glue code to the bindings crate and adds a config option (`treemanifest.bfsdiff`) to enable the new functionality.

Reviewed By: xavierd

Differential Revision: D17334739

fbshipit-source-id: 24aac21910e74a42d625c93bed7fa3aa08e167c0
2019-09-12 18:28:43 -07:00
Marla Azriel
db1873cb7b commands: help text for hide, unhide
Summary: Updated help text for hg hide, hg unhide

Reviewed By: quark-zju

Differential Revision: D17134586

fbshipit-source-id: a38c64926f1a5fdf5f97ab7b8ac743024439f7ee
2019-09-12 17:31:30 -07:00
Zeyi (Rice) Fan
e14b09a08c graphql: do not try to parse commit info if it is not a dict
Summary: Diffusion does not have local commit information for imported diffs (e.g. imported from GitHub), and it will return a list for such commits. This will break `hg ssl`. We can simply skip it if Diffusion is giving us list.

Reviewed By: quark-zju

Differential Revision: D17334156

fbshipit-source-id: 4c4278de94e24c646a3e789377c12f42adb4307e
2019-09-12 10:40:51 -07:00
Arun Kulshreshtha
467f602d64 remotefilelog: add prefetch method to remotetreestore
Summary: Add a prefetch method to the `remotetreestore` in the `treemanifest` extension, along with the necessary plumbing to call it from Rust code.

Reviewed By: quark-zju

Differential Revision: D17335773

fbshipit-source-id: 2b71638f56ea7e1398348f437d737a599d8be476
2019-09-12 10:24:46 -07:00
Thomas Orozco
f1ec1ef07c lfs: log remote server
Summary:
This adds the remote server to logging in the lfs extensions, which will let us
know which LFS server we're talking to. This is only collected on batch
requests.

Reviewed By: ikostia

Differential Revision: D17341928

fbshipit-source-id: a458ba3b0a4dce1b3f4ab3ea0d509f9715044f0e
2019-09-12 06:35:42 -07:00
Thomas Orozco
9bcfe8c170 lfs: send client correlator
Summary:
This updates the LFS extension to send a client correlator when connecting to a
LFS server. This might be helpful for troubleshooting.

Reviewed By: quark-zju

Differential Revision: D17319281

fbshipit-source-id: 3549c0710ad010f9566a961abeedfbb5366bf49c
2019-09-12 02:33:21 -07:00
David Tolnay
e84e100f06 Delete extern crate lines
Summary:
`extern crate` is usually no longer needed in 2018 edition of Rust. This diff removes `extern crate` lines from fbcode where possible, replacing #[macro_use] with individual import of macros.

Before:

```
#[macro_use]
extern crate futures_ext;
extern crate serde_json;
```

After:

```
use futures_ext::try_boxfuture;
```

Reviewed By: Imxset21

Differential Revision: D17313537

fbshipit-source-id: 70462a2c161375017b77fa44aba166884ad2fdc3
2019-09-11 22:02:16 -07:00
Aleksei Kulikov
b94ce91b33 snapshot: fix coding utf-8 comments
Reviewed By: markbt

Differential Revision: D17228034

fbshipit-source-id: b3fb280bcaede2c42029b38c8e145e12695741c8
2019-09-11 06:38:41 -07:00
Aleksei Kulikov
a0e092de37 snapshot: add a command to list the local snapshots
Reviewed By: markbt

Differential Revision: D17227370

fbshipit-source-id: 363f45431824b574cc298eb5c0f40c334f1d916b
2019-09-11 06:38:41 -07:00
Stefan Filip
b2471ea3c6 phabricator: check for error field in reponse
Summary:
The latest error reponses that we see for phabricator have only one field called
`error` that lists a message. Adding handling for this case.

Reviewed By: quark-zju

Differential Revision: D17290349

fbshipit-source-id: ebfd9d7b07f30cbfe3171259efcfc6a00a1abdce
2019-09-10 16:32:34 -07:00
Xavier Deguillard
5ca548a963 remotefilelog: add an option to no longer read loosefiles
Summary:
With `remotefilelog.fetchpacks` enabled everywhere, loosefiles are no longer
being generated. Let's add an option that no longer reads the ones that are
left on disk.

Reviewed By: quark-zju

Differential Revision: D17263163

fbshipit-source-id: fa801232be4f6c2df959f57e818a418400246b5e
2019-09-10 13:10:42 -07:00
Xavier Deguillard
9e88acbdf7 remotefilelog: remove local loosefile generation
Summary:
The `remotefilelog.packlocaldata` has been on for a while now. Instead of
keeping the code around, let's simply remove it and fix all the tests that
assume a commit will generate loosefiles.

Reviewed By: quark-zju

Differential Revision: D17244837

fbshipit-source-id: e65ed16c9818be61be9ccbe19ce3fa18c890d70b
2019-09-10 13:10:42 -07:00
Xavier Deguillard
ba7455367e remotefilelog: check for data existence with getmissing
Summary:
As loosefiles are deprecated and being removed, testing for a filenode should
also consider looking into packfiles and indexededlogs. One easy way to achieve
this is to use the getmissing API that the various stores have.

Reviewed By: quark-zju

Differential Revision: D17244835

fbshipit-source-id: 5ef0d5a048bb61fb0945167c61d77829ee4570e1
2019-09-10 13:10:42 -07:00
Xavier Deguillard
d922fd7c8f remotefilelog: send local packs on shallow clone
Summary:
During a shallow clone, all the local loosefiles from the server are sent over
the wire. Usually, this is never exercised, expect when the clone is pulling
from another shallow client, which may have local data. Since loosefiles are no
longer being generated for draft commits, we also need to send the local
packfiles, make sure these are sent too.

Reviewed By: quark-zju

Differential Revision: D17244836

fbshipit-source-id: 52e6d3cba8c42e69bf782e220b9561be7a6268ab
2019-09-10 13:10:41 -07:00
Xavier Deguillard
50465d67cb remotefilelog: remove unused _read method
Summary: This method is unused, let's remove it.

Reviewed By: quark-zju

Differential Revision: D17244838

fbshipit-source-id: e328360aa48dd194d1ff5358842dc30ec37fdfdc
2019-09-10 13:10:41 -07:00
Xavier Deguillard
63e18be4d6 treemanifest: use Rust repack for server treemanifest repack
Summary:
We were still using the Python based repack, let's switch to the Rust one. As
far as I can tell, this code is unused, so the test change should be safe to
do.

Reviewed By: quark-zju

Differential Revision: D17207643

fbshipit-source-id: 89d0ba85327077dfc4e26c55ade3284beeb44b50
2019-09-10 11:36:00 -07:00
Aleksei Kulikov
b7ee506bfa snapshot: keep a list of snapshots in .hg/store/snapshotlist
Reviewed By: markbt

Differential Revision: D17226709

fbshipit-source-id: fefa31227f77295793ccaa3448f4488274f70848
2019-09-09 10:38:22 -07:00
Aleksei Kulikov
377e1200a7 snapshot: add -m option to set up a custom snapshot message
Reviewed By: markbt

Differential Revision: D17206496

fbshipit-source-id: a6e190ca87aa5309e359a5cecd6c6bc40634ca8d
2019-09-06 08:18:36 -07:00
Aleksei Kulikov
ccc05d0d65 snapshot: remove lfs dependency completely
Summary: Also remove debug commands that are strictly related to remote lfs.

Reviewed By: markbt

Differential Revision: D17184902

fbshipit-source-id: da38a2150212500bab62191ddcfab0990276605e
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
22dce8230d snapshot: bundle metadata and the related files
Summary:
Instead of the lfs remote storage it was chosen to send the snapshot metadata via bundles.
Snapshot metadata consists of: the actual metadata blob + several other blobs (untracked files etc).
If we have several snapshot revisions in a single bundle, the blobs could repeat.
Then we should store each blob as a separate entry in a binary stream, keeping its id and contents.

Here we introduce a new bundle part type `"b2x:snapshotmetadataparttype"`.
```
1 byte of version info
[ # a list of binary entries, each corresponds to a separate file
  # (either a metadata file itself or a related -- externally stored -- file)
  <oid><length><data>
  :oid: is a 64char string with the hash of the file
  :length: is an unsigned int with length of the data
  :data: is binary data of length <length>, the actual file contents
]
```

So far there is an ongoing discussion on the exact format of serialization.
Actual state is at [the quip doc](https://fb.quip.com/R5OVAzabX8oo).

Reviewed By: markbt

Differential Revision: D17184222

fbshipit-source-id: 90f833ec71556e90d513e3be3f3efa7f870b037d
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
bcd08fcda3 snapshot: store metadata version as int
Summary: That way it'll be easier to pack it into a blob.

Reviewed By: markbt

Differential Revision: D17183018

fbshipit-source-id: 44e21103f201aafb6f417a5b5a7b3d4735f32039
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
732a5baa9a snapshot: use local snapshot storage instead of lfs
Summary: In the next diff I will replace remote lfs with bundle2

Reviewed By: markbt

Differential Revision: D17132405

fbshipit-source-id: a0dfff3ebad067abb0231cf31de08ae62affe7ce
2019-09-06 08:18:35 -07:00
Mark Thomas
d21fc6233a treemanifest: don't purge shared packs while repack is running
Summary:
If treemanifest finds there are too many shared packs (more than
`packs.maxpackfilecount`) then it will purge them.  This is a shame if there is
currently a repack in progress, as it will purge the packfiles from underneath
the repack, deleting lots of cache data that will be imminently repacked).

Skip the purge if there is a repack ongoing.

Reviewed By: mitrandir77

Differential Revision: D17155854

fbshipit-source-id: 20d46f29c252e508177b1fde08ca7a69841dcd7e
2019-09-06 00:40:52 -07:00
Jun Wu
0b570f65a7 stablerev: pass information using environment variables
Summary:
Instead of hardcoding `--target <target>` and hardcode `$2` in the script.
Let's just use environment variables so `target` and other things have explicit
names.

Explicit set `REAL_CWD` so the script can learn the current directory before
it gets reset to the repo root.

Reviewed By: xavierd

Differential Revision: D17213186

fbshipit-source-id: 6a4fc4cf2cbf6e2c623400bc6bc13f7758a46c49
2019-09-05 15:53:37 -07:00
Xavier Deguillard
0cd7a9cb8f remotefilelog: add a config to use the Rust PackStore
Reviewed By: quark-zju

Differential Revision: D17187153

fbshipit-source-id: 57faa956598600e520dfea3cd05de981e5caae1c
2019-09-05 10:21:27 -07:00
Xavier Deguillard
375d91a518 remotefilelog: add make{datapackstore, historypackstore}
Summary: Let's consolidate these 2 to allow easy switching the the Rust based one.

Reviewed By: quark-zju

Differential Revision: D17187154

fbshipit-source-id: 5ccadabac2e2e4b684ca44917f1502e9a05d41d6
2019-09-05 10:21:27 -07:00
Jun Wu
d66ac32198 metaedit: support -M / --reuse-message
Summary:
This makes metaedit support `-M / --reuse-message`, which I found handy when
rewriting prototype commits to formal commits.

Reviewed By: xavierd

Differential Revision: D17168991

fbshipit-source-id: fa768a2916ea3ef4db4c31a48989d10897379e92
2019-09-04 17:06:36 -07:00
Jun Wu
fd071d2076 cmdutil: change logmessage to take a repo
Summary:
Change `cmdutil.logmessage` to take a `repo` instead of `ui`. This makes the
next change easier.

Reviewed By: xavierd

Differential Revision: D17168990

fbshipit-source-id: 47c1707e5a9dbf06d07452b4c400903453992379
2019-09-04 17:06:35 -07:00
Jun Wu
1e027a58e7 fsmonitor: warn about slow full-repo scans
Summary:
I have seen multiple user complaints about slow hg commands that turned out to
be fsmonitor scanning the whole working copy. Print a warning in those cases.
Hopefully this can reduce our oncall burden a bit.

Reviewed By: xavierd

Differential Revision: D17170520

fbshipit-source-id: 8fd5721d123853136c84229d936c3e0c999f3d87
2019-09-04 14:14:51 -07:00
Jun Wu
c637c9d08c copytrace: log domergecopies time
Summary:
I found this very slow. Log it so we can have some ideas about how long it
takes for others.

Reviewed By: xavierd

Differential Revision: D17066510

fbshipit-source-id: 3f9de9b816bcd2d062beb44bc03ea4114d829596
2019-09-04 13:37:40 -07:00
Jun Wu
925ef09146 treemanifest: log findrecenttrees time
Summary:
`findrecenttrees` can take very long in my case - it only tests 1280 trees in
30 seconds. Log it so we can get some ideas about how long it takes.

As we're here, teach `util.timefunction` to figure out the `ui` object
automatically.

Reviewed By: xavierd

Differential Revision: D17066278

fbshipit-source-id: 7e59c8683359a7ce8d4e87fde92af36b95d37b2f
2019-09-04 13:37:39 -07:00
Jun Wu
5def63525a sigtrace: use smarttraceback and print to stderr
Summary:
Make sigtrace use smarttraceback so it prints more context.
As we're here, also make it print to stderr so we don't need to find the
traceback from /tmp.

Reviewed By: xavierd

Differential Revision: D17066277

fbshipit-source-id: 9a1000803fed27a71ec381b8ddbd76400dae99c9
2019-09-04 13:37:39 -07:00
Aleksei Kulikov
bead18e577 lfs: move abstract local blobstore to core mercurial
Summary: It will be used by snapshot extension too.

Reviewed By: markbt

Differential Revision: D17132134

fbshipit-source-id: 6c9fc285e0f1eb445bfa0abe0b6f4de4a1bd1db0
2019-09-04 11:09:36 -07:00
Aleksei Kulikov
4576ab19c2 lfs: move lfsvfs to vfs.py
Summary:
now blob vfs will be in core mercurial. It will be used by snapshot
extension too.

Reviewed By: quark-zju

Differential Revision: D17112671

fbshipit-source-id: e721749d27db37f55bb9eb6af3ea042e8036ddfa
2019-09-04 11:09:36 -07:00
Aleksei Kulikov
1cc68aac23 snapshot: split the extension code into files
Summary: Preparation for lfs deprecation in snapshot extension.

Reviewed By: quark-zju

Differential Revision: D17112040

fbshipit-source-id: aa55a631d1f03180ffea741c71bcf801fb4fc147
2019-09-04 11:09:36 -07:00
Aleksei Kulikov
c193470431 snapshot: prohibit regular checkout on snapshot
Differential Revision: D17093630

fbshipit-source-id: 4425c90fbdecfa3edc9f34f677e0be6b771aa0af
2019-09-04 11:09:35 -07:00
Stefan Filip
edfeb9f529 treemanifest: remove delta storing of manifest entries when autocreate
Summary:
It is somewhat difficult to fetch the raw entry on the p1 side in the Rust
Manifests. These entries are used to write deltas to revlogs or to datapacks.

Reviewed By: xavierd

Differential Revision: D17143551

fbshipit-source-id: 6624116324664354d199d5f6ac55712c8ed29b9d
2019-09-03 15:08:34 -07:00
Mark Thomas
013aa19333 mutation: don't allow divergence when rebasing
Summary:
In general, mutation tracking doesn't care about divergence.  However, in the
case of rebase, it doesn't make sense to allow divergence to occur if we can
avoid it by omitting some of the commits to rebase.

This makes rebase behaviour more like old obsmarker-based behaviour.  This
breaks a test for mutation copying markers, so update those to use metaedit,
which has the copying behaviour for both obsmarkers and mutation.  At some
point we should make rebase behave better in these cases.

Reviewed By: quark-zju

Differential Revision: D17136480

fbshipit-source-id: 9e465b7fc8bda33e7a746e4df68410713e2be37e
2019-09-02 03:13:51 -07:00
Xavier Deguillard
a8f9884152 remotefilelog: add bindings for the IndexedLogHistoryStore
Summary: This plumbs it everywhere to be on-par with the historypack.

Reviewed By: quark-zju

Differential Revision: D17104465

fbshipit-source-id: 0e5b9343388b81f21609a38978816bd729102e1b
2019-08-30 18:30:48 -07:00
Xavier Deguillard
2274399ed8 remotefilelog: refactor hg debughistorypack
Summary:
Move the code that isn't proper to an historypack to a separate function. This
will be used to implement a similar functionality for the
IndexedLogHistoryStore

Reviewed By: quark-zju

Differential Revision: D17104466

fbshipit-source-id: 905a4c4c63d8bbb54611fcb9521ab3039d1b56fd
2019-08-30 18:30:47 -07:00
Xinyue Zhang
6331cb6323 Update stablerev.py to work on Windows
Summary:
1.) Windows doesn't support close_fds if stdin/stdout/stderr is redirected. It throws out this Exception: 'close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr'. This diff resolves this issue by importing mercurial util to use file_fd only on posix
2.) Originally, stable is implemented as a mercurial extension and gets expanded as the following (take update as an example):
```
hg up stable
   -> calls getstablerev("--pick-best") in stable.py
   -> calls a bash script in hg repo, e.g. ovrsource or fbsource
```
However, bash is not supported on Windows.
To resolve this, this diff sets up cwd in `subprocess.Popen` and then modifies stablerev to take in a command in string format instead of a script. This way, we can pass in either the bash script for fbsource(backward compatible) or `python <xxx.py>` for ovrsource.

Reviewed By: quark-zju

Differential Revision: D17140170

fbshipit-source-id: ea8ae76883cc34a0517fa7e9eae3cbb3ba901353
2019-08-30 16:48:18 -07:00
Xavier Deguillard
0f125b4073 remotefilelog: commit the dirty shared mutable packs on transaction abort
Summary:
Since the shared mutable packs contain fetched data from the network, not
commiting them means that we would need to redownload the data again. Let's
persist them on disk instead to avoid having to redownload them.

Reviewed By: quark-zju

Differential Revision: D17115796

fbshipit-source-id: 3e213461c7a864156ee4c6c68e6a042294883f9d
2019-08-30 16:14:52 -07:00
Xavier Deguillard
4b28370d5e remotefilelog: local loosefiles should always be fully repacked
Summary:
The loosefiles repack was made incremental to greatly reduce the repack time
for users. Since the amount of local loosefiles should be way smaller than the
amount of shared ones, let's always run a full repack on the former. This
should allow us to kill all the local loosefiles, which will help in no longer
supporting them.

Reviewed By: quark-zju

Differential Revision: D17135975

fbshipit-source-id: 9480993b31aa57d0d6e6b7caffd282929183f782
2019-08-30 15:09:25 -07:00
Xavier Deguillard
81614017c6 remotefilelog: remove repack Python fallback
Summary:
Now that we're past the point of being not confident about the Rust repack
code, we can remove the fallback code. Instead, let's fail hard if the Rust
repack fails.

Reviewed By: quark-zju

Differential Revision: D17135979

fbshipit-source-id: a521a4f9267361a167bba61968659557bed35e20
2019-08-30 15:09:24 -07:00
Xavier Deguillard
6e0b6a2161 remotefilelog: Rust repack is the default
Summary:
Rust repack has been the default for a while now. Let's stop pretending we're
going to switch back to the Python repack by removing the config entirely.

Reviewed By: quark-zju

Differential Revision: D17135977

fbshipit-source-id: 5aaa0faa48e2b40a7314d5ab455f5eeaa4e4984d
2019-08-30 15:09:24 -07:00
Jun Wu
b178492317 changelog: disable inline revlog
Summary:
The inline revlog format merges `.i` and `.d` into one `.i` file. It was intended to reduce the
number of files for filelogs. For the changelog one extra file does not hurt.

This makes it easier to write native code parsing the changelog revlog index.

Reviewed By: xavierd

Differential Revision: D17125922

fbshipit-source-id: f48ffe0d2df71abec007a80e05b684dcbac71883
2019-08-30 14:58:02 -07:00
Wez Furlong
3a13d58d7a Back out "hg: wrap convert in a big transaction for better pack behavior"
Summary:
I broke some svn tests in that commit, but while fixing forward
realized that we're blocked from making this change because we rely on
rolling back the last commit in the case where the filemap creates an
empty commit.

We can revisit this when we have convert this all to rust!

Reviewed By: sfilipco

Differential Revision: D17140172

fbshipit-source-id: c93911f599afd2d22e84b3327a2a9455204065a0
2019-08-30 14:53:21 -07:00
Wez Furlong
846de7e82f hg: wrap convert in a big transaction for better pack behavior
Summary:
We noticed that the runtime for convert was exponential
due to way that packs were managed.

This wraps the convert in a big transaction so that we reuse an
existing pack rather than writing out one for each commit.

Reviewed By: xavierd

Differential Revision: D17138073

fbshipit-source-id: 46e418a49f917e2ffc411920ace1a3d98ac6b8e4
2019-08-30 14:10:00 -07:00
Xavier Deguillard
689256b99d remotefilelog: handle missing directory
Summary:
Wez noticed that when /var/cache/hgcache/<repo>/packs/manifest was missing, `hg
repack` would fail, not repacking anything. Let's fix the offending code to
properly ignore the missing directory.

Reviewed By: quark-zju

Differential Revision: D17120206

fbshipit-source-id: 7a7aebac717e5f128565ea2f8d50ffaeda4563f9
2019-08-30 11:23:22 -07:00
Stefan Filip
ffb563f1bb manifest: add subdir_diff compatibility function for gettreepacks
Summary:
The C++ manifest implements walksubdirtrees which is used to compute the packs
that a "client" wants for a prefetch. In terms of interface the function is very
annoying and couples with storage and tree representations without being part
of any of them.

We reproduce that functionality as a means to replace the C++ implementation.
The long term goal is to do lazy fetches using an iteration style that plays
nicer with batching downloads.

This change also includes fastmanifest updates because they are required to
enable the walksubdirtrees functionality in our tests.

Reviewed By: quark-zju

Differential Revision: D17086669

fbshipit-source-id: 6c1f9fbf975814f0a2071f8d1c8e022e5ad58e29
2019-08-30 10:50:05 -07:00
Thomas Orozco
fa4e12df09 wireproto logging: capture getpack
Summary:
ignore-conflict-markers

This updates Mercurial to add a loggetpack option for wire proto logging that
allows capturing getpack responses. This will be useful to verify correctness
for ovrsource on Mononoke (right now, Mononoke isn't serving traffic for hosts
that use getpack).

Reviewed By: StanislavGlebik

Differential Revision: D17091537

fbshipit-source-id: 755a429949d7645010dddab95202c613025f2984
2019-08-30 05:08:18 -07:00
Xavier Deguillard
309229fdf5 remotefilelog: do no build the entire ancestormap in remotefilectx.parents
Summary:
While working on a stack, I noticed that `hg amend -e` would sometimes download
a lot of history information. For a 4 files change, I saw 738 history entry
fetched individually...

Looking at the profile, this pointed towards remotefilectx.parents requesting
the entire ancestormap. Since that function really only need the nodeinfo,
let's only get that.

Reviewed By: DurhamG

Differential Revision: D17104263

fbshipit-source-id: fae1f673b2d2a641ae4f22d1099317cc5abd8447
2019-08-29 09:51:38 -07:00
Thomas Orozco
243716cdc4 commitcloud: add missing parameter
Summary:
Someone reported an error in this function being called with a missing
argument.

Reviewed By: quark-zju

Differential Revision: D17110694

fbshipit-source-id: 65adbae7e1380652afd1cec8bd3e2bbef27268dd
2019-08-29 09:06:34 -07:00
Aleksei Kulikov
33f371d27c snapshot: bugfix - do not miss the metadata in clean merge state
Summary:
So far we missed the metadata if there were no changes in the WC.
A metadata file was created but was not attached to the commit.

Differential Revision: D17070211

fbshipit-source-id: 646c8bceb575f4302ec60e35472cc55de086d7e0
2019-08-28 03:56:13 -07:00
Jun Wu
49fc1209f1 rage: filter out less interesting entries from blackbox
Summary:
Filter out legacy logs without messages and the `remotefilelog` entries so the
blackbox section can look cleaner.

Reviewed By: sfilipco

Differential Revision: D17054398

fbshipit-source-id: 6485f1832fc12d6f68ed3fb1efe3dbc853af4b1f
2019-08-27 12:11:01 -07:00
Shu-Ting Tseng
439e4c6825 port D16833526 to gitrevset
Summary:
See https://fb.workplace.com/groups/corehg/permalink/448152285780007/ for context.

D16833526 was to add extras lookup for translating hg hash to git hash. However we
also have gitrevset extension which still does mapfile lookup. THis diff should port
the same improvement for it.

Reviewed By: DurhamG

Differential Revision: D17070479

fbshipit-source-id: e469707b0b21541aa2c3b90d1480b04afc4f1485
2019-08-27 11:56:01 -07:00
Jun Wu
3e4443737f lib: remove cargo workspace
Summary:
The workspace was added by D8741175 mainly to make build artifacts share a same
"target" directory.  D14606468 made `setup.py` write a `.cargo/config` that
specifies a sharable "target" directory. Remove the workspace since the crates
already share a "target" directory.

This makes it a bit easier to add new crates.

Reviewed By: singhsrb

Differential Revision: D17053934

fbshipit-source-id: d34781c796356b725ddce3453c1951a4d4133807
2019-08-26 17:34:34 -07:00
Xavier Deguillard
2d396615a9 remotefilelog: remove duplicated reportpackmetrics
Summary: This is already called in makeunionstores, no need to call it a second time.

Reviewed By: quark-zju

Differential Revision: D16794078

fbshipit-source-id: ff4c51d64748dfe4160a26767af11f7ebeb82618
2019-08-26 11:38:54 -07:00
Stefan Filip
98b32be924 manifest: remove the dirs function from the manifest
Summary:
There is no custom implementation for manfiest.dirs(). Generally speaking
the custom implementation is a good thing but doing the migration in the
current python codebase doesn't seem worth while at the moment.

Reviewed By: quark-zju

Differential Revision: D16775351

fbshipit-source-id: c428860d21088a50a0f754dc20d6ee224d2eae32
2019-08-26 10:48:07 -07:00
Durham Goode
3d5cc68c87 treemanifest: prevent fetches that pass the target as the base
Summary:
We've seen problems where we send requests to the server for a manifest
node and claim that we have that same node as the base node. This results in the
server sending no data back. This is obviously a bug in the client, since if
we're trying to fetch the node it means we don't have it and shouldn't use it as
a base. Our current best guess is that the node is in the index but the actual
data is corrupt, so getmissing() claims it exists, but reads actually fail.

Until we figure out the root cause, let's prevent findrecenttree from returning
the node as a base to itself.

Reviewed By: sfilipco

Differential Revision: D16996425

fbshipit-source-id: 04b0cfbe1c432749f2aeb63f98c7b59ab50facc0
2019-08-23 15:30:11 -07:00
Mark Thomas
756ee47bf3 commitcloud: add blackbox logging of cloud changes
Summary:
Add blackbox logging of syncing to or from the commit cloud workspace,
including which changes are being submitted.

Also log when obsmarker fixup happens in blackbox.

Reviewed By: quark-zju

Differential Revision: D16961281

fbshipit-source-id: 0d0f675d77ab3446198703b31eea940dae3bdd85
2019-08-23 05:03:38 -07:00
Stefan Filip
62e7989ad9 treemanifest: add logging for fetches with basemfnode==mfnode
Summary:
It is unclear where we generate basemfnodes that get to be equal to mfnodes
in our requests to the server. This logging allows us to track the codepath
that is problematic.

Reviewed By: quark-zju

Differential Revision: D16969888

fbshipit-source-id: b2d0aa7b573180664ad5cf8d6909451f089ac4a5
2019-08-22 14:20:02 -07:00
Jun Wu
4a8387c725 hgext: use commit hashes to call other commands
Summary:
Search for `commands.(update|rebase)` and change them accordingly to avoid
triggering revnum deprecation messages.

Reviewed By: singhsrb

Differential Revision: D16964237

fbshipit-source-id: c12077c6e143766cba5264cc1fbe0d8cc15c69a2
2019-08-22 13:00:14 -07:00
Jun Wu
06859de4e2 prune: pass commit hash to commands.update
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16963944

fbshipit-source-id: 2fce56bc2c9deefaceec3ec89d6e3c784ca9da48
2019-08-22 13:00:14 -07:00
Jun Wu
b87bd484e6 histedit: use commit hash internally
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16955293

fbshipit-source-id: eb5196c694b105a10f9a4424ca87aed8bac46281
2019-08-22 13:00:14 -07:00
Jun Wu
3e8db21b78 restack: use commit hash internally
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16955289

fbshipit-source-id: 799b6e548ad08e9b9fdcc5d2c7ca792c9eb5684b
2019-08-22 13:00:13 -07:00
Jun Wu
0668c348e3 amend/movement: disable revnum warning for internal use of rebase
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16955291

fbshipit-source-id: b9d37dc4c18c438dc64e25f5aa4e8e72155da0bd
2019-08-22 13:00:13 -07:00
Jun Wu
272e2948fa split: pass commit hash to the revert command
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16955292

fbshipit-source-id: e32e242416474185700db5331610dd2faa78b7c4
2019-08-22 13:00:12 -07:00
Jun Wu
38bf97ab62 directaccess: avoid false positive detection of revnum usage
Summary:
Similar to the previous diff, opt out the revnum detection for the `repo.revs`
call used internally by directaccess to calculate revs.

Change smartlog to disable the revnum detection for its internal calculation.
Carefully choose the scope so `smartlog(1+2)` will still be warned.

Reviewed By: singhsrb

Differential Revision: D16954996

fbshipit-source-id: 2612055a8a9bb2fc9bdd1946c4bc565f967b22ca
2019-08-22 13:00:12 -07:00
Jun Wu
17f66b3e1f smartlog: avoid false positive detection of revnum usage
Summary:
If `smartlog()` is the user input, the revnum detection is enabled for the
whole scope of smartlog revset implemenation. The use of rev numbers triggers
the warning. But the user didn't use any rev number.

Change smartlog to disable the revnum detection for its internal calculation.
Carefully choose the scope so `smartlog(1+2)` will still be warned.

Reviewed By: singhsrb

Differential Revision: D16954997

fbshipit-source-id: 1a3d32c1c2bcba08bfac908623b6416cf1cd63a8
2019-08-22 13:00:12 -07:00
Aleksei Kulikov
b8088a8a9e snapshot: rename commands to non-debug ones
Summary:
Instead of `debugsnapshot` and `debugcheckoutsnapshot` we will use
`snapshot create|checkout`.

Reviewed By: markbt

Differential Revision: D16961037

fbshipit-source-id: 142d072672376c2ce6a248a4dceffdd94d56a4df
2019-08-22 09:32:04 -07:00
Aleksei Kulikov
216bd69c29 snapshot: add version info to snapshot metadata
Reviewed By: markbt

Differential Revision: D16941087

fbshipit-source-id: 10d1857060dafcda2005a14d731758a2221ad7fd
2019-08-22 09:32:04 -07:00
Aleksei Kulikov
e8c5b4830f snapshot: rename manifest to metadata
Summary: Snapshot `metadata` won't be confused with regular commit manifest.

Reviewed By: markbt

Differential Revision: D16929553

fbshipit-source-id: 466b167aa1cc30f137e0c0b4601d70876509e03c
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
71a0402c8a snapshot: fix dirstate behavior during snapshot checkout
Summary:
At first, that aim was to create a good and consistent test plan of snapshots:
```
# Snapshot test plan:
# 1) Empty snapshot (no changes);
# 2) Snapshot with an empty manifest (changes only in tracked files);
# 3) Snapshot with a manifest (merge state + mixed changes);
# 4) Same as 3 but test the --clean flag on creation;
# 5) Same as 3 but test the --force flag on restore.
```
Then I discovered some bugs while writing the tests.
1) In case of an empty manifest the `snapshotmanifestid` extra should be an empty string, not `None`.
This is because of the extra serialization rules.
2) The initial approach for doing the checkout did some unnecessary operations with dirstate,
which required it to rollback later.
Now the overhead is gone, and the strategy of checking out is as follows:
```
1. Regular hg update to the (1st) parent of the snapshot;
2. Apply all the changes via mergemod.update without pushing it to the dirstate;
3. Register these changes in the dirstate;
4. Tie the second snapshot parent to the working context, if it exists.

Reviewed By: markbt

Differential Revision: D16929417

fbshipit-source-id: 0319ac0e81f80956cdef5b2a696b642cc782f48d
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
c9be937325 snapshot: remove --hidden flag when expicitly accessing snapshots
Summary: Snapshots have invisible commits underneath them, so that flag is redundant.

Reviewed By: markbt

Differential Revision: D16916268

fbshipit-source-id: 294f34af5aa7942be0bb2b58f0dc65979d593157
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
2401518de9 snapshot: bugfix - make files missing instead of removed on checkout
Summary: Due to a bug the missing files from the snapshot manifest were marked as removed after checkout.

Reviewed By: markbt

Differential Revision: D16831796

fbshipit-source-id: 200ccf34b16392a73d38294f1fcb43bfa9a94690
2019-08-21 10:36:33 -07:00
Aleksei Kulikov
8cebfd9c65 snapshot: add --clean option to snapshot cmd
Summary:
It cleans the working copy, equivalent of `hg checkout --clean && hg
purge`.

Reviewed By: markbt

Differential Revision: D16831349

fbshipit-source-id: d765f2f36f561786ec57bc1e54fdf81695f1e7e0
2019-08-21 10:36:33 -07:00
Jun Wu
38e2d2870c amend: backout D16910636 which logically conflicts with D16898856
Summary:
D16910636 and D16898856 both add a `hex` call to a `node`. That results
in a 80-char commit id, which breaks 20+ tests.  Back out D16910636 to fix
tests.

Reviewed By: simpkins

Differential Revision: D16931869

fbshipit-source-id: 5794cd6a2d1d1eda87c525231ef15b621f2074c5
2019-08-20 18:12:02 -07:00
Jun Wu
2d1524d978 amend/movement: convert commit rev to hash before calling commands.update
Summary: This removes a false positive detection of "revision number used".

Reviewed By: singhsrb

Differential Revision: D16910636

fbshipit-source-id: d30d04f1a793598b75eab6adb07d4f9c18cb85a1
2019-08-20 17:21:09 -07:00
Jun Wu
8b2c9a1534 hgext: clean up scmutil.rev* usage
Summary:
`scmutil.rev*` should not be used for non-user-provided input. Change them to
`repo.anyrevs` or `repo[]` instead. This should reduce false positives of
revision number usage detection.

Reviewed By: singhsrb

Differential Revision: D16910637

fbshipit-source-id: b53bc9ba4ee52cb37c86f819d70898c14a6c569f
2019-08-20 17:21:09 -07:00
Mark Thomas
540f1f0828 amend: use commit hashes rather than revision numbers for moverelative
Summary:
Use of revision number is being deprecated.  Change the moverelative commands
(`next`, `previous`, ...) to use nodes internally.

Reviewed By: mitrandir77

Differential Revision: D16898856

fbshipit-source-id: 71f6fc32776e2912795f086d11897d36b942b608
2019-08-20 11:45:23 -07:00
Kostia Balytskyi
745d39caf5 redaction: rename relevant constants into their desired names
Summary:
We do not want to use censorship/blacklisting, as those names are ambiguous
and redaction has exactly the meaning we need.

Reviewed By: quark-zju

Differential Revision: D16890423

fbshipit-source-id: 1a6dcc61ca3fe77b7a938a37fb1ec9250ae9e15a
2019-08-20 04:02:14 -07:00
Mark Thomas
ff3570739f commitcloud: reformat context managers for sync pull
Summary:
Using many context managers doesn't format well with Black because of the way
Python `with` syntax works.

Instead, construct all the context managers ahead of the call, making the
`with` statement short enough to fit on a single line.

Reviewed By: quark-zju

Differential Revision: D16831187

fbshipit-source-id: 331a8aea4e039e14a88f268c430c0fd7c793b292
2019-08-20 03:54:28 -07:00
Shu-Ting Tseng
4d2004114f use hex() instead of rev() in unshelve
Summary: In hg unshelve, it's still using the rev number. Lets switch it to the node().

Reviewed By: singhsrb

Differential Revision: D16895784

fbshipit-source-id: c4bf765e2cec3e59eeb1a9d0fa1e3cafc57029aa
2019-08-20 02:32:34 -07:00
Jun Wu
ec304e1d1e commands: assign 'd' alias to 'diff'
Summary:
Git does not have command name prefix matching. We now use `commands.names`
config options as a hint to avoid going to the Python land for command
prefix matching. It works but is not "correct". If we drop the prefix matching
feature, then the problems are gone - fast paths won't need prefix matching
aka. the command name list, and slow path (ex. wrong command) can afford
loading Python for all command names.

`hg d` is the single most used prefix matching command. Assign an explicit
alias to it to avoid regression if we do drop prefix matching (or, make
that more expensive than resolving commands direcly).

Reviewed By: sfilipco

Differential Revision: D16733274

fbshipit-source-id: 8904288b8a1ddf1fc6e6ec54ffaa36e503ebdb77
2019-08-19 19:27:29 -07:00
Jun Wu
d0cf5aacfa dispatch: remove Python alias handling
Summary:
This removes Python alias handling so the alias handling is done entirely in
Rust.

There are some subtle changes - alias using prefix mathcing to ambiguous
commands will not show other aliases. Hopefully that won't be a big issue.
Users can always avoid prefix matching in alias to solve the issue.

Reviewed By: sfilipco

Differential Revision: D16733270

fbshipit-source-id: 54a4915d49c2b2f6e8664a225a9c0f25e1c38d17
2019-08-19 19:27:29 -07:00
Marla Azriel
b5cc850992 commands: help text for redo, metaedit
Summary: Updated help text for hg redo and hg metaedit

Reviewed By: markbt

Differential Revision: D16723556

fbshipit-source-id: 9859d921f8e39880a0edc28c87f66d48268069dd
2019-08-19 11:34:26 -07:00
Mark Thomas
43bc04968a commitcloud: backup and sync all non-public commits
Summary:
Commit cloud and infinitepush currently only back up draft commits, omitting
secret ones.  However, commit cloud sync with visibility enabled will try to
sync all visible commits, including the secret ones.  This means users with
secret commits won't be able to sync them to their other machines as they won't
have been backed up.

We eventually want to get rid of the secret phase, which means all non-public
commits should be synced.  Update commit cloud to backup and sync all
non-public commits, including secret ones.

Currently secret commits become draft when they are received by the other
machine.  Since we're planning to get rid of the secret phase, this should be
fine.

Reviewed By: mitrandir77

Differential Revision: D16830832

fbshipit-source-id: 2ce4447ffa750a2edcb194cdf92321c1393ff805
2019-08-16 10:24:44 -07:00
Mark Thomas
94ff729e43 commitcloud: close connection between cloud sync pulls
Summary:
Connecting to large workspaces can result in many pulls within a single sync.
This re-uses the connection to the server.  We have seen instances where the
server can't serve all of these pulls and crashes with a MemoryError.

Pragmatically close the connection between each pull to prevent this.

Reviewed By: farnz

Differential Revision: D16858728

fbshipit-source-id: 7561c6f01c38df2706bd7fd76f5a7387e9728dc8
2019-08-16 10:19:25 -07:00
Aleksei Kulikov
0f11c07409 snapshot: fix windows tests and make hashes deterministic
Summary:
So far the hashes of manifest/commits may vary, mostly because of
different path separators on different platforms (`/` vs `\\`) and its serialization to string in the snapshot manifest.

Reviewed By: markbt

Differential Revision: D16856130

fbshipit-source-id: a19dff113b9b24f1c7f387b9bc5a5e39e83ef8af
2019-08-16 10:15:05 -07:00
Shu-Ting Tseng
150798aac8 translate from hg to git hash should use the extras
Summary:
Now that we are writing the git hash inside the commit itself, if we are translating
from hg to git hash, we should just use that rather than loading the entire map and
build a dict and look it up.

The performance of this translation will also improve quite a lot.

Some small sample benchmarking:

```
suiting@devvm5006:configerator  (659199b|remote/master)$ time ~/fbcode/scm/hg/hg log -r master -T '{node} || {gitnode}\n' --config exte
nsions.fbconduit=! --config extensions.hggit=
659199bf7c7850ea9ffa9e0ad50eb84597977dea || 69f05aeec13f09c44dd00d2a85fe9d461ba6841e

real    0m0.563s
user    0m0.004s
sys     0m0.007s
suiting@devvm5006:configerator  (659199b|remote/master)$ time ~/fbcode/scm/hg/hg log -r master -T '{node} || {gitnode}\n'
659199bf7c7850ea9ffa9e0ad50eb84597977dea || 69f05aeec13f09c44dd00d2a85fe9d461ba6841e

real    0m14.706s
user    0m0.006s
sys     0m0.006s
```

Reviewed By: quark-zju

Differential Revision: D16833526

fbshipit-source-id: 7d3096649cf24967d13596e70463bc125081ba4f
2019-08-16 07:09:31 -07:00
Jun Wu
bf056a2962 revset: start deprecating revision number resolution
Summary:
The upcoming changelog change will *have to* use a different set of numbers.
Some of the numbers might be generated on demand, which has difficulity
resolving a number to a commit hash.

There are a lot of internal (especially, tests) usecases of revision numbers.
The deprecation message is only shown for user-provided inputs (ex. things
that go through `scmutil.revrange`).

This does not affect the use of `{rev}` template yet.

Reviewed By: sfilipco

Differential Revision: D16795522

fbshipit-source-id: 7a5578ecc0afdcc86830238471ff95203c96dc3f
2019-08-15 13:24:56 -07:00
Jun Wu
8b4c670550 changelog: get access to config options
Summary: Pass `uiconfig` to changelog so it can read config options.

Reviewed By: sfilipco

Differential Revision: D16683785

fbshipit-source-id: a64cfbe2cefa6b20ec695d2766bcfe878c764323
2019-08-15 12:47:35 -07:00
Jun Wu
6d7c287ab2 ui: split config handling to a separate class
Summary:
A large portion of `ui` is config handling. Split it to a separate class so we
can pass that separate class to places that need pure configuration.

Some `develwarn`s are skipped since the new class does not have access to fout
or ferr.

Reviewed By: DurhamG

Differential Revision: D16683787

fbshipit-source-id: d823b9e5fc6f8ed08fff3401ab3502ad3c434f00
2019-08-15 12:47:35 -07:00
Aleksei Kulikov
ad771fcaec snapshot: minor codestyle fixes
Summary: Minor changes.

Reviewed By: mitrandir77

Differential Revision: D16829944

fbshipit-source-id: 08876408bab9a367b852e85e1d7ca86dc0da08a3
2019-08-15 10:48:42 -07:00
Aleksei Kulikov
97c6c6ddaf snapshot: add debugcheckoutsnapshot command
Summary:
Allow the user to check out on the snapshot by its revision id.
Snapshot == "a commit with extra containing a key `snapshotmanifestid`".
This corresponding value can be `None`, that would mean that snapshot does not contain untracked/missing/merge files.

Reviewed By: mitrandir77

Differential Revision: D16788479

fbshipit-source-id: bf4a9508acc940290b18123d3dd7b7fefae83782
2019-08-15 10:48:41 -07:00
Aleksei Kulikov
b45ba7a551 snapshot: add --force option to manifest checkout
Summary:
Now `hg debugcheckoutsnapshotmanifest` overwrites files if given the `--force` flag.
It also gives a more detailed output on the changes it makes.

Reviewed By: mitrandir77

Differential Revision: D16786334

fbshipit-source-id: b41d6241ffb478bd6c30a01c154b095d1ea92d78
2019-08-15 10:48:41 -07:00
Aleksei Kulikov
169465460a snapshot: add debugsnapshot command
Summary:
Add the `debugsnapshot` command, which will be renamed to `snapshot` later.

It creates a snapshot manifest that features information about
* untracked files,
* missing files,
* merge state artifacts from `.hg/merge` and `.hg/rebasestate`.
The snapshot manifest is stored in local lfs.

Then it creates the actual snapshot -- a fake commit, which has the snapshot oid in extra data.
It does not handle unresolved merge conflicts and other difficult states on this stage.

~~Finally, it restores the working copy and dirstate to status quo.~~
It doesn't need to be done, now we create only the commitctx, which does not wreck the dirstate.

Reviewed By: mitrandir77

Differential Revision: D16716359

fbshipit-source-id: 743f7427ce89c3fca6f844487bac1c456338e613
2019-08-15 10:48:41 -07:00
Mohammad Ayoub
075801c976 sync checkout locations on update
Summary:
Whenever a checkout is done, the new commit is sent to commitcloud.
This currently works with the hook on update, but the hooks on commit are not working

Reviewed By: mitrandir77

Differential Revision: D16687423

fbshipit-source-id: a0b861d301c84764f31787454cdec594b0519fa3
2019-08-15 08:37:14 -07:00
Jun Wu
2dad4c70d1 fastlog: add an option to use fastlog for files
Summary:
The fastlog code says it cannot handle file renames, which is not true as far
as I know. Therefore, try use it for files. This affects the `follow()` revset.

I picked a random file, and fastlog is faster than the alternative code path
even with warm cache:

With fastlog:

  % ./hg log edenscm/mercurial/smartset.py --time --pager=off -T '.' --debug --config fastlog.files=1
  found common parent at a320f95a23716d0d106d922fa07ffcf0f838d3ff
  starting fastlog at a320f95a23716d0d106d922fa07ffcf0f838d3ff
  .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
  time: real 2.060 secs (user 1.870+0.000 sys 0.290+0.000)

Without fastlog, cold cache:

  % sudo rm /var/cache/hgcache/fbsource/packs/*.hist*; ./hg log edenscm/mercurial/smartset.py --time --pager=off -T '.' --debug --config fastlog.files=0
  fastlog: not used because fbcode/scm/hg/edenscm/mercurial/smartset.py is not a directory
  .fetching content for 1 file over HTTPS
  35.56 kB downloaded in 147 ms over 1 request (0.24 MB/s; latency: 147 ms)
  fetching history for 1 file over HTTPS
  445 B downloaded in 56 ms over 1 request (0.01 MB/s; latency: 56 ms)
  running ssh -oControlMaster=no hg.vip.facebook.com 'hg -R '\''/data/scm/fbsource?stage1_read'\'' serve --stdio'
  sending hello command
  sending between command
  remote: 713
  remote: capabilities: unbundlehash gettreepack pushkey getfile getflogheads listkeyspatterns knownnodes getbundle lookup treeonly stream_option remotefilelog known unbundle=HG10GZ,HG10BZ,HG10UN clienttelemetry branchmap changegroupsubset unbundlereplay batch bundle2=HG20%0Ab2x%253Ainfinitepush%0Ab2x%253Ainfinitepushmutation%0Ab2x%253Ainfinitepushscratchbookmarks%0Ab2x%253Arebase%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Atreemanifest%3DTrue%0Atreemanifestserver%3DTrue%0Atreeonly%3DTrue streamreqs=generaldelta,lz4revlog,revlogv1 getannotate stream-preferred
  remote: 1
  sending clienttelemetry command
  connected to hg020.prn2.facebook.com
  sending getpackv2 command
  ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
  876 files fetched over 876 fetches - (1 misses, 99.89% hit ratio) over 5.98s
  (running background incremental repack)
  time: real 11.920 secs (user 5.050+0.000 sys 0.470+0.000)

Without fastlog, warm cache:

  quark@devvm33994 ~/fbcode/scm/hg % ./hg log edenscm/mercurial/smartset.py --time --pager=off -T '.' --debug --config fastlog.files=0
  fastlog: not used because fbcode/scm/hg/edenscm/mercurial/smartset.py is not a directory
  .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
  time: real 2.530 secs (user 2.050+0.000 sys 0.070+0.000)

This is one step forward getting rid of the legacy filenode / ancestormap
logic. It regresses on offline experience, but we can build simple caches
around the `follow()` revset later.

Reviewed By: markbt

Differential Revision: D16365331

fbshipit-source-id: 16ffd6c3ec2daa5530fed94fb9c41fe75efd6182
2019-08-13 19:12:17 -07:00
Xavier Deguillard
3f21c278d4 remotefilelog: Rust repack is the default
Summary:
This option has been on for several months now, let's enable it by default in
the tests too. Since the behavior is slightly different, the tests had to be
adjusted:
  - The packfile hashes are different due to a different repack algorithm,
  - test-fb-hgext-remotefilelog-gcrepack.t removed due to gc not being a thing
    with the Rust repack,
  - test-fb-hgext-remotefilelog-repack-corrupt.t corrupt packs aren't detected
    and removed at repack time, but later,
  - test-fb-hgext-remotefilelog-repack.t we no longer re-delta context in the
    Rust repack

Reviewed By: quark-zju

Differential Revision: D16774858

fbshipit-source-id: 7b7a3d96598c1ded0f64237047c3d97510050e4a
2019-08-13 10:50:02 -07:00
Kostia Balytskyi
3767b9c61a remotefilelog: remove unneeded len comparison
Reviewed By: HarveyHunt

Differential Revision: D16782324

fbshipit-source-id: 6924763fa423d4fa516052e01e5e13b0262a8779
2019-08-13 03:59:28 -07:00
Xavier Deguillard
97a6bc8e6a remotefilelog: run python repack even if the pack directory doesn't exist
Summary:
When rust repack is default, and the packs directory doesn't exist, we wouldn't
try to run the loosefile repack, even if we had some. Let's move the packs
directory check a bit later to allow the loosefile repack to run.

Reviewed By: quark-zju

Differential Revision: D16774857

fbshipit-source-id: 1d1b67ae93c1b3aa2d07d5d15325e9be16a01196
2019-08-12 20:08:00 -07:00
Xavier Deguillard
d257546639 remotefilelog: simplify options management in repack
Summary:
Let's always make options non-None. This was causing some issues when switching
to the Rust repack by default.

Reviewed By: quark-zju

Differential Revision: D16774856

fbshipit-source-id: 16fcda0b5a38327d389ed03f87c73d8bd00d5877
2019-08-12 20:08:00 -07:00
Kostia Balytskyi
f4042cad44 remotefilelog: add censorship handling at a filelog level
Summary:
Currently, only contents coming from `getfiles` request can replace
`BLACKLISTED_CONTENT` with `BLACKLISTED_MESSAGE`, because this is implemented
in `basestore.py`. Let us add an additional piace of logic to the
`remotefilelog.revision`, which would handle this the same way.

Note: this diff does not remove the old implementation. I think we need to do
this, but I want to focus on solving immediate problem, which is the absense
of support for censored results in `getpackv1`/`getpackv2`, before I fix the
tech debt. Note also that current doubling of the replacement logic does not hurt,
since it can't apply twice.

Reviewed By: xavierd

Differential Revision: D16735899

fbshipit-source-id: f10b72997614c58432476bcf95a3bde774bc278e
2019-08-12 08:04:58 -07:00
Aleksei Kulikov
98ae814cd0 snapshot: add merge/rebase data to snapshot
Summary:
This diff adds handling of mergestate and rebasestate -related data from the `.hg` directory.
That is the whole `.hg/merge` folder (both for merge and rebase state) and the `.hg/rebasestate` file.

We do not store any other information in lfs (e.g. number of parents for merge state).
Snapshot manifest oid will be added as an extra field to a fake snapshot commit, which will contain such data.

Differential Revision: D16708733

fbshipit-source-id: efc9b72b7593d85063307528c713c363e061065b
2019-08-12 03:51:58 -07:00
Jun Wu
98086c8f4d treemanifest: fix a null pointer undefined behavior
Summary:
`path.next(&word, &wordlen)` might choose to do nothing if `path.isfinished()`
is already true. In that case, null pointer `word` would be passed to callback
functions and that breaks UBSAN:

  scm/hg/edenscm/hgext/extlib/ctreemanifest/manifest.cpp:84:23: runtime error: null pointer passed as argument 1, which is declared to never be null
  glibc/include/string.h:140:33: note: nonnull attribute specified here
      #0 0x7f7068badb26 in Manifest::findChild(char const*, unsigned long, FindResultType, bool*) scm/hg/edenscm/hgext/extlib/ctreemanifest/manifest.cpp:84
      #1 0x7f7068bc07cb in get_callback(Manifest*, char const*, unsigned long, FindContext*, ManifestPtr*) scm/hg/edenscm/hgext/extlib/ctreemanifest/treemanifest.cpp:315
      #2 0x7f7068bbdbce in treemanifest::find(ManifestEntry*, PathIterator&, FindMode, FindContext*, FindResult (*)(Manifest*, char const*, unsigned long, FindContext*, ManifestPtr*), ManifestPtr*) scm/hg/edenscm/hgext/extlib/ctreemanifest/treemanifest.cpp:218
      #3 0x7f7068bbfd4b in treemanifest::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const**, FindResultType, ManifestPtr*) scm/hg/edenscm/hgext/extlib/ctreemanifest/treemanifest.cpp:355
      #4 0x7f7068c1e8bb in treemanifest_contains(py_treemanifest*, _object*) scm/hg/edenscm/hgext/extlib/cstore/py-treemanifest.h:1400
      #5 0x7f707746ba7e in PyEval_EvalFrameEx (libpython2.7.so.1.0+0x108a7e)
      ....

This unblocks D16716742.

Reviewed By: singhsrb

Differential Revision: D16750880

fbshipit-source-id: f0afe19f98b97660698b2cb90f24a0243f1e728f
2019-08-09 20:59:52 -07:00
Arun Kulshreshtha
73e1fc5143 remotefilelog: return after HTTP file fetch
Summary: We were accidentally double-fetching data over both HTTP and SSH due to a missing return statement in the HTTP path. Fix it so that we only fetch data once. (The return was originally there, but was accidentally removed as part of a refactor.)

Reviewed By: xavierd

Differential Revision: D16745110

fbshipit-source-id: e06f129d39dec3801a32f90257367266006bb1cc
2019-08-09 16:37:12 -07:00
Saurabh Singh
437c059dc6 phabricator: handle AttributeError while parsing graphql query
Summary:
We have can have situations where the parsing is broken because we are
parsing an attribute that does not exist. See T48658402 for an example.

Reviewed By: kulshrax

Differential Revision: D16745842

fbshipit-source-id: f693bc5aca29923b074a789b952e24b5ce72cdfd
2019-08-09 15:31:17 -07:00
Shu-Ting Tseng
f26bbc7e98 fix hg svn info
Summary:
The logic is currently a bit broken in a weird combination:

The current configurations are
- usefirstpublicancestorinsvninfo=False
- useglobalrevinsvninfo=True

This means hg will have to traverse back to the last hg commit with svnrev. It will get
[slower and slower](https://fburl.com/scuba/skfj8p7u) to find those commits as we are having more commits without snvrev.

Ideally we can turn `usefirstpublicancestorinsvninfo` to True and that will then only traverse back to the last public ancestor. However it will trigger another bug because this public ancestor won't be in the old svn revmap and therefore hg will just bail with "Not a child of an svn revision".

Therefore the fix is to fix that bug by moving the `if pn not in hashes:` into the else part of the config and also get the subdir value from config rather than from the `extras['convert_info']`.

The next step is to set
- usefirstpublicancestorinsvninfo=True
- useglobalrevinsvninfo=True
- usereposubdirinsvninfo=True
once this diff is deployed to stable.

Reviewed By: DurhamG

Differential Revision: D16717554

fbshipit-source-id: c05b9882aa9ddeeeefd9315b478ba085fbc9bae7
2019-08-08 14:19:03 -07:00
Aleksei Kulikov
1bb26d4ad2 snapshot: refactor extension code
Summary:
Created some classes and refactored the code.
Now it looks better. :)

Reviewed By: markbt

Differential Revision: D16690240

fbshipit-source-id: f26127d55c5cace7b88e225c85ec13cc278150c8
2019-08-08 04:13:39 -07:00
Aleksei Kulikov
6b7127c966 snapshot: add debug command to checkout on snapshot manifest
Summary:
It would really help to be able to checkout the manifests, restoring all the data from them.
Deleting the missing files, creating the unknown files, adding mergestate info to svfs (not available yet :) ).

Reviewed By: mitrandir77

Differential Revision: D16668312

fbshipit-source-id: 62af8a1fb11541c162f7b5ceb8d6d058cad9a319
2019-08-08 04:13:38 -07:00
Mark Thomas
6a6c0fea7a commitcloud: add automigrate to automatically connect to commitcloud
Summary:
Add automigrate to commitcloud, which will automatically connect the user's
repo to commit cloud on pull.

Reviewed By: mitrandir77

Differential Revision: D16666810

fbshipit-source-id: a1d0857164d2ce6bf1db5784360681f04d35ed90
2019-08-08 03:09:24 -07:00
Mark Thomas
2e3cda1ade commitcloud: cloud leave should always clear the workspace name
Summary:
Running `hg cloud leave` on a repo that was never connected should mark the
repo as explicitly disconnected so that automatic joining will not try to
connect the repo later on.

Reviewed By: quark-zju

Differential Revision: D16687470

fbshipit-source-id: 0552ffa42a1dac40874bba30eeb93509a2227aeb
2019-08-08 03:09:24 -07:00
Mark Thomas
0c6db94ffb commitcloud: simplify subscription manager
Summary:
The `SubscriptionManager` is never a long-lived object, and cannot be
constructed if the user is not connected to a workspace.  Simplify this to
function calls, which are safe to call at all times.

Reviewed By: quark-zju

Differential Revision: D16687467

fbshipit-source-id: c7f81290a3e8012f7b154af3398771ac9254387f
2019-08-08 03:09:24 -07:00
Mark Thomas
be096ab1c6 commitcloud: make cloud rejoin always join if possible
Summary:
`hg cloud rejoin` limits joining to when the user has an authentication token
and the workspace already exists.  If the user uses a different authentication
method, or if the workspace is brand new, the rejoin does nothing.

Change this to always attempting to join, and only printing a message if the
join failed because of an authentication error, prompting the user to authenticate.

Reviewed By: mitrandir77

Differential Revision: D16666365

fbshipit-source-id: 3ea4542125a1b5266711fab2c31d9455ab764cef
2019-08-08 03:09:23 -07:00
Arun Kulshreshtha
18d9581d7e treemanifest: add single-node lazy HTTP tree fetching
Summary:
When `treemanifest.usehttp` is enabled, make `remotetreestore` fetch tree nodes over HTTP rather than SSH.

Note that unlike the SSH prefetch operation, this downloads only a single tree node, which will change the I/O behavior of Mercurial to fetch manifest nodes on demand. In general, this will result in excessive round trips, but for certain commands (such as `hg cat`), this works reasonably well.

Future diffs will expand upon this functionality to make the HTTP behavior more performant. For now, this won't affect anyone unless they specifically enable the aforementioned config option.

Reviewed By: xavierd

Differential Revision: D16663197

fbshipit-source-id: 4117e057996ed30f0bfd186238264e31484c2620
2019-08-07 19:09:46 -07:00
Aleksei Kulikov
cf0570d74a snapshot: add a command to upload snapshot manifest to remote lfs
Summary:
Add the `debuguploadsnapshotmanifest oid` command.

It checks that the local lfs has `oid`, then uploads it and all the related blobs to remote lfs.

Differential Revision: D16667158

fbshipit-source-id: 2978a6c0e7c58c3710f8253cf7b9ab36b24886ce
2019-08-07 05:57:45 -07:00
Arun Kulshreshtha
7302c42b77 remotefilelog: start HTTP file fetching progress bars at 0
Summary:
Previously, we would use `None` as the start value for HTTP data fetching progress bars so that the bar would be rendered as a spinner until we received a response (which would contain a content size header, allowing us to set the progress bar total).

This would result in incorrect behavior if the server took a long time to return a response, because by default if no start value is provided the progress bar framework will display the number of seconds that have elapsed. Given that we've specified a byte count format function for the progress value, the progress bar would end up displaying the number of seconds elapsed as a byte count, which was very confusing.

Reviewed By: quark-zju

Differential Revision: D16663124

fbshipit-source-id: 0e224b3b670abc803356214cd12205a6f4259cd9
2019-08-06 17:14:58 -07:00
Stefan Filip
5bc614c767 bindings: add finalize implementation for tree manifests
Summary: Matching more of the existing API.

Reviewed By: quark-zju

Differential Revision: D16607233

fbshipit-source-id: 7a71f22089067ecfccbfcb2ad072fbf21e360439
2019-08-06 14:24:31 -07:00
Arun Kulshreshtha
8ba2df04d9 treemanifest: remove bulky HTTP prefetch
Summary:
The initial attempt at supporting tree fetching over HTTP involved reimplementing the existing Mercurial prefetch functionality (corresponding to the gettreepack wireproto command) in the API server. Unfortunately, while this worked from a functionality perspective, it was far too slow to be usable in practice.

Rather than maintaining this unused code path, let's remove it and repurpose the config flag for a more sensible version of HTTP tree fetching.

Reviewed By: farnz

Differential Revision: D16663198

fbshipit-source-id: a489d5ca177b788f93383b8a9f758316e889ca5b
2019-08-06 11:40:05 -07:00
Xavier Deguillard
9937459abe remotefilelog: remove old files in the hgcache that aren't packfiles
Summary:
The hgcache packs directory is being written to in several places, most of the
files being created there are temporary ones and renamed once ready to be
visible. In some cases, when hg crashes midway, or when the packfile is mmap'ed
on windows, temporary files are left around.

While we were trying to remove these files before, the solution taken involved
removing files we knew were safe to be removed. Unfortunately, that meant we
missed some of the temporary files. Let's instead switch to removing everything
but packfiles and the repacklock.

Reviewed By: kulshrax

Differential Revision: D16657105

fbshipit-source-id: f4dd45aa71c02acba52a745b9bec3019d20e03c4
2019-08-06 10:34:27 -07:00
Mark Thomas
bafa640cde unhide: improve performance of unhide revset
Summary:
Add `not public()` to the unhide revset to improve its performance.  We can't
unhide public commits anyway, as they can't be hidden.

Reviewed By: mitrandir77

Differential Revision: D16645983

fbshipit-source-id: f9f23e7e31050e652f1389489734416fe3278219
2019-08-06 09:52:02 -07:00
Aleksei Kulikov
cbf11e8ca8 snapshot: add command debugcreatesnapshotmanifest
Summary:
Add a self-descriptive command `debugcreatesnapshotmanifest`.
For now it supports only deleted and unknown files.

1) Uploads all the untracked files to the local lfs storage.
2) Creates a json-like snapshot with the following structure:
```
{
  "deleted": {
    "path/to/file": None, # this is done for consistency
    "path/to/another/file": None
  },
  "unknown": {
    "added": {
        "oid": "oid in local blobstore",
        "size": 42
    }
    "another/added": {
        "oid": "another oid in local blobstore",
        "size": 24
    }
  }
}
```
...and stores it in the local blobstore.

Reviewed By: markbt

Differential Revision: D16621864

fbshipit-source-id: 6c497d1bb756561b3c3368483b838a2307b0b5f9
2019-08-05 11:10:17 -07:00
Jorge Lopez Silva
a1fd50cc9b Upgrade smc/hg to cpython/python-sys 0.3
Summary: Bump cpython and python27-sys to 0.3.

Reviewed By: quark-zju

Differential Revision: D16634957

fbshipit-source-id: 9f6b45baf8098399109ad03bf440da42f4483fcb
2019-08-05 09:56:45 -07:00
Shu-Ting Tseng
bbc6d19715 use manifest lookup to speed up operations
Summary:
The original code path is extremely slow because it has to iterate all files in manifest.
The new path instead only has to lookup the entries in keptdirs and therefore is O(change).

Reviewed By: mitrandir77

Differential Revision: D16646075

fbshipit-source-id: cb2c152d236ffa6f01349c223c9470205c540379
2019-08-05 05:22:40 -07:00
Johan Schuijt-Li
77f0d3fd04 lfs: rewind fp on retries
Summary:
To avoid the scenario where we are incorrectly uploading the data that we're
supposed to upload, we need to reset the file pointer to read from the
beginning so that for each retry of uploading we get the correct data.

Previously before this patch, Mercurial would have nothing to upload on a retry
and the connection would 'hang' waiting for the data to be send to the server.

Reviewed By: krallin

Differential Revision: D16620072

fbshipit-source-id: 2238b99ff612e06dc0640717bc42fe345c35037d
2019-08-02 05:15:57 -07:00
Arun Kulshreshtha
0f9f07b6a1 remotefilelog: make HTTP retries configurable
Summary: Make the number of retries for HTTP operations configurable. Previously, they were hardcoded to 3, which may not be ideal in situations where the retries are caused by server side timeouts. (If a single timeout takes 30 seconds it would take 90 seconds to fall back to SSH.)

Reviewed By: quark-zju

Differential Revision: D16592862

fbshipit-source-id: a9ba5273a1271532ff9814bcc47cb32e60ee87b7
2019-08-01 12:54:35 -07:00
Stefan Filip
71bff70aea manifest: rename filesnotin argument from match to matcher
Summary:
Similar to diff, the `match` argument can't be easily expressed using CPython
crate bindings. This argument is not used a lot so we can rename it.

Reviewed By: quark-zju

Differential Revision: D16571840

fbshipit-source-id: 19c7dea82924b7ec4c0b66d1675b9ad4569f8b62
2019-08-01 10:35:53 -07:00
Mohammad Ayoub
c3bb7153e0 change cloud sl --version_number to --workspace-version
Summary: Change --version_number flag to --workspace-version

Reviewed By: quark-zju

Differential Revision: D16561670

fbshipit-source-id: 797a7b2fee2c3e260263ae3029d793452def3033
2019-08-01 02:18:05 -07:00
Stefan Filip
71ab0b4b3d manifest: rename match to matcher in diff argument list
Summary:
`match` is a keyword in Rust. This is causing troubles in adding Rust bindings
for functions that use that as a keyword argument. Renaming the argument to
something else seems to be the easiest path forward.

Reviewed By: quark-zju

Differential Revision: D16496134

fbshipit-source-id: c923f49577564527a99d43dda3d3d9da43122b3e
2019-07-31 10:06:48 -07:00
Stefan Filip
5d1f390ca0 manifest: remove the clean argument from diff
Summary:
The diff algorithm takes the `clean` flag. When `clean` is used all the files
that are not changed between the two manifests are returned. In short the set
of files is equal to |files(M1) U files(M2)|.

This functionality would have to be implemented in the Rust manifest. I don't
feel that a flag on the diff algorithm should be used in this case. First, I
don't like how it interacts with the core diff algorithm, it changes it to the
point where it feel like it should be a different function. Second is that this
behavior can be achieved by getting all the files in the manifest and removing
the items in the diff. Third is that this operation is done quite rarely, being
so expensive.

The downside is that the places where this flag is used get a bit more
expensive.

Reviewed By: quark-zju

Differential Revision: D16496136

fbshipit-source-id: 205dcc23517b896de5c14634683bcbd5f2aa6666
2019-07-31 10:06:47 -07:00
Shu-Ting Tseng
97f4a710b9 don't use revmap to look for ancester in hg svn info
Reviewed By: singhsrb

Differential Revision: D16561866

fbshipit-source-id: 156477a4ecc7bf205158c13e57960a0cf1dc368e
2019-07-31 09:16:23 -07:00
Shu-Ting Tseng
acec61a376 hg svn info should print globalrev
Summary:
This is used by Jellyfish and sent to Phabricator. In the future, we won't have svnrev
and therefore we should use globalrev instead.

More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/

Reviewed By: singhsrb

Differential Revision: D16561651

fbshipit-source-id: 284ad26b1bf77f222086bb7e2104b1c2dbf65449
2019-07-31 09:16:23 -07:00
Shu-Ting Tseng
01394c9202 hg debugcrdump should also use globalrev
Summary:
This command uses svnrev directly. However once we migrate to www-hg, this fields will
go and we can only use globalrev instead.

Let's add that and put it behind a config.

More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/

Differential Revision: D16560447

fbshipit-source-id: de3100ed1e6cc39eaaeff2fe11af04d2f1e2c41a
2019-07-31 09:16:23 -07:00
Mateusz Kwapich
6b7f8fe167 autoformat all of fbcode/scm with black
Summary: blackpylogo

Reviewed By: krallin

Differential Revision: D16543521

fbshipit-source-id: 75977d00329e1068a92a344c99e0ad0392601c54
2019-07-30 08:21:05 -07:00
Jun Wu
67cd8c9b81 demandimport: blacklist IPython dependencies
Summary: This makes IPython work without disabling demandimport.

Reviewed By: xavierd

Differential Revision: D16509106

fbshipit-source-id: d4443d8b58c90a0fd7a34c620756e88f4f788337
2019-07-29 13:45:44 -07:00
Saurabh Singh
459d04df3f hgsubversion: allow disabling the svnrev template keyword
Reviewed By: quark-zju

Differential Revision: D16546466

fbshipit-source-id: d3d3005b250856d2e93fbd52f178e9cd8bdf6ef2
2019-07-29 13:29:39 -07:00