Commit Graph

43003 Commits

Author SHA1 Message Date
Liubov Dmitrieva
8eb1968255 obsshelve: do not use secret phase
Summary: obsshelve: do not use secret phase

Reviewed By: ryanmce

Differential Revision: D7380531

fbshipit-source-id: 21538d42a43f019b894dd1a77ba0adc67798936a
2018-04-13 21:51:35 -07:00
Jun Wu
ae0142473d progress: suspend progress when shelling out
Summary:
The progress bar runs in another thread and may draw " <=> " which pollutes the
current screen.

Make `ui.system` suspend the progress bar automatically. This should work for
the "invoking editor" case. I think sshaskpass and curses might also need to
suspend the progress bar but those are trickier.

Reviewed By: singhsrb

Differential Revision: D7377492

fbshipit-source-id: 833ac724bbe4f9c630ca37567dc088f7279dd67e
2018-04-13 21:51:35 -07:00
Jun Wu
3859d00394 indexedlog: implement flush for the main index
Summary:
The flush method will write buffered data to disk.

A mistake in Root entry serialization is fixed - it needs to translate dirty
offsets to non-dirty ones.

Reviewed By: DurhamG

Differential Revision: D7223729

fbshipit-source-id: baeaab27627d6cfb7c5798d3a39be4d2b8811e5f
2018-04-13 21:51:35 -07:00
Jun Wu
8f5c35c8d2 indexedlog: initial main index structure
Summary:
Add the main `Index` structure and its constructor.

The structure focus on the index logic itself. It does not have the checksum
part yet.

Some notes about choices made:
- The use of mmap: mmap is good for random I/O, and has the benefit of
  sharing buffers between processes reading the same file. We may be able to
  do good user-space caching for the random I/O part. But it's harder to
  share the buffers between processes.
- The "read_only" auto decision. Common "open" pattern requires the caller
  to pass whether they want to read or write. The index makes the decision
  for the caller for convenience (ex. running "hg log" on somebody else's
  repo).
- The "load root entry from the end of the file" feature. It's just for
  convenience for users wanting to use the Index in a standalone way. We
  probably

Reviewed By: DurhamG

Differential Revision: D7208358

fbshipit-source-id: 14b74d7e32ef28bd5bc3483fd560c489d36bf8e5
2018-04-13 21:51:35 -07:00
Martijn Pieters
85eb89e007 sparse: make listing profiles a subcommand
Summary:
This is based on the hg show implementation. hg sparse --list-profiles is not yet widely known, so now is the time to move it to a subcommand.

This is the first step in untangling the mess that is the `hg sparse` forest of options.

Currently, all switches on the command are mutually exclusive, except for `—force` and `—template`, which each only apply to a subset of the actions the other switches affect.

Subcommands are the right pattern for mutually-exclusive actions that can accept their own individual switches.

Reviewed By: quark-zju

Differential Revision: D7350928

fbshipit-source-id: d03014cf7edd2f089f670d11465c70940d96c070
2018-04-13 21:51:35 -07:00
Kostia Balytskyi
6f265bb8d5 hg: when shelling our from rage, pass shell=True to subprocess.Popen
Summary:
Without `shell=True`, `Popen` does not find `.bat` files, just `.exe` files.
The way `arc` is deployed (to at least some people) does not create a `.exe`
shim and only has a `.bat` in the PATH.

FYI: https://stackoverflow.com/questions/41860668/why-does-this-python-subprocess-command-only-work-when-shell-true-on-windows?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Reviewed By: quark-zju

Differential Revision: D7370386

fbshipit-source-id: ad9e2006893e71b2a9e8cd1a480f9188e412a931
2018-04-13 21:51:35 -07:00
Jun Wu
545f670504 pathencoding: utility for converting between bytes and paths
Summary:
A simple utility that does paths <-> local bytes conversion. It's needed
since Mercurial stores paths using local encoding in manifests.

For POSIX, the code is zero-cost - no real conversion or error can happen.
This is in theory cheaper than what treedirstate does.

For Windows, the "local_encoding" crate is selected as Yuya suggested the
`MultiByteToWideChar` Win32 API [1] and "local_encoding" uses it. It does
the right thing given my experiment with GBK (Chinese, simplified) encoding.

```
  ....
  C:\Users\quark\enc>hg debugshell --config extensions.debugshell=
  >>> repo[0].manifest().text()
  '\xc4\xbf\xc2\xbc1/\xce\xc4\xbc\xfe1\x00b80de5d138758541c5f05265ad144ab9fa86d1db\n'
  >>> repo[0].files()
  ['\xc4\xbf\xc2\xbc1/\xce\xc4\xbc\xfe1']
  extern crate local_encoding;
  use std::path::PathBuf;
  use local_encoding::{Encoder, Encoding};
  const mpath: &[u8] = b"\xc4\xbf\xc2\xbc1/\xce\xc4\xbc\xfe1";
  fn main() {
      let p = PathBuf::from(Encoding::OEM.to_string(mpath).unwrap());
      println!("exists: {}", p.exists());
      println!("mpath len: {}, osstr len: {}", mpath.len(), p.as_path().as_os_str().len());
  }
  exists: true
  mpath len: 11, osstr len: 15
```

In the future, we might normalize the paths to UTF-8 before storing them in
manifest to avoid issues.

Differential Revision: D7319604

fbshipit-source-id: a7ed5284be116c4176598b4c742e8228abcc3b02
2018-04-13 21:51:35 -07:00
Kostia Balytskyi
731f87492f hg: make rage errors more friendly
Summary:
We've seen cases when `suprocess.Popen` fails [1], [2]. It might happen if
`arc` binary is not in `$PATH` env var. Let's fail gracefully.

[1] https://fburl.com/7hcq73as
[2] https://fburl.com/u1v0es8q

Differential Revision: D7365459

fbshipit-source-id: ce838f434cb81211c334d6f170fd25ef30edaabd
2018-04-13 21:51:35 -07:00
Liubov Dmitrieva
1c8877987d https connector
Summary: https connector for commit cloud

Reviewed By: mjpieters

Differential Revision: D7306672

fbshipit-source-id: c95388964a1aced82579c0d55ccdd0a9ef391e81
2018-04-13 21:51:35 -07:00
Durham Goode
d87789e3e7 hg: store repo on manifestlog instead of changelog
Summary:
Previously we were storing the changelog on the manifestlog and using
it to resolve linkrevs before serializing them. It turns out the changelog can
be invalidated at a different rate than the manifestlog, so we could encounter
issues where the manifestlog held a reference to the old changelog.

To fix this, let's hold a reference to the repo and access the changelog from
there when we need it. This introduces a circular reference between the
manifestlog and the repo, but it's probably fine for now until we can get rid of
the need for changelog invalidation.

Reviewed By: singhsrb

Differential Revision: D7360321

fbshipit-source-id: 2317c7fcd6b307a50b64f0c5df97dda2955f3e21
2018-04-13 21:51:35 -07:00
Mark Thomas
0827683bf0 remotefilelog: show names of files being downloaded in the progress bar
Summary:
When remotefilelog downloads filelog information for a particular file, set the
progress bar item to that file.  This means if we get stuck on a particular
file, there is feedback to the user as to which file that is.

Reviewed By: quark-zju

Differential Revision: D7329503

fbshipit-source-id: 94416962cdc4c97994f76e8ed9203823aeca3d64
2018-04-13 21:51:35 -07:00
Mark Thomas
0d739795cc progress: add fancyrenderer for colorful progress bars
Reviewed By: quark-zju

Differential Revision: D7329656

fbshipit-source-id: b6592319177387d615547ff27f8f38efe85838ba
2018-04-13 21:51:34 -07:00
Mark Thomas
8d01284b55 progress: re-implement progress bar engine
Reviewed By: quark-zju

Differential Revision: D7329657

fbshipit-source-id: 4ba5152269ea8a598f13f0ae1e9e792c3b9542bb
2018-04-13 21:51:34 -07:00
Mark Thomas
aa338235f8 util: add util.ring, a ringbuffer of fixed length
Reviewed By: quark-zju

Differential Revision: D7329654

fbshipit-source-id: fa918ba5e77dc444705737be7e34bbb3c70f91ef
2018-04-13 21:51:34 -07:00
Mark Thomas
e09288137b ui: deprecate ui.progress
Summary:
Remove ui.progress as a method of updating progress.  All progress bars now go
through new-style progress bars.

This also splits out the rendering of progress bars from the reporting of
progress.  All tests are updated to use new-style debug progress bars, which
simply report the position of the progress bar.  Rendering of progress bars
will be tested separately once the progress bar engine has been rewritten.

Reviewed By: quark-zju

Differential Revision: D7329488

fbshipit-source-id: 14f8ab67365ddd98b74986aa25d9abc7a0546144
2018-04-13 21:51:34 -07:00
Mark Thomas
d67787ff6a upgradegeneraldelta: use new-style progress bars
Reviewed By: mjpieters

Differential Revision: D7329492

fbshipit-source-id: 49cac8963e36702569fdfa32856fca59452629b0
2018-04-13 21:51:34 -07:00
Mark Thomas
896813a257 treemanifest: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329497

fbshipit-source-id: aa19b579e6b57dd08271abf94f370e5491515d96
2018-04-13 21:51:34 -07:00
Mark Thomas
e59d61a2f5 remotefilelog: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329507

fbshipit-source-id: 9648bb7ec34a682238fc9ede96e8cdf63a45bdf9
2018-04-13 21:51:34 -07:00
Mark Thomas
79e7eb9a8e relink: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329513

fbshipit-source-id: a801e9c13f6c4912bffa9c08994e899761c1fc08
2018-04-13 21:51:34 -07:00
Mark Thomas
1ee8d6bace rebase: use new-style progress bars
Reviewed By: mjpieters

Differential Revision: D7329479

fbshipit-source-id: 75b53d9ca34b3670c60a79138a388f096a4a7275
2018-04-13 21:51:34 -07:00
Mark Thomas
2f6ee7d5e2 patchbomb: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329489

fbshipit-source-id: 3ac24272c286d47a61ed131ba217a2a9d07d9839
2018-04-13 21:51:34 -07:00
Mark Thomas
ced425bc04 p4fastimport: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329509

fbshipit-source-id: 5006ab9555d37102e430a6c6d9994d869ec512dc
2018-04-13 21:51:34 -07:00
Mark Thomas
4d96e98cae linkrevcache: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329505

fbshipit-source-id: 674729586260d218c3d070d0d36a8e57def817a7
2018-04-13 21:51:34 -07:00
Mark Thomas
b91b10e988 lfs: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329485

fbshipit-source-id: 4d6763ca6eed94a72ba59b1f8c8e4a506d8b5929
2018-04-13 21:51:33 -07:00
Mark Thomas
b1d366cb34 histedit: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329484

fbshipit-source-id: 038b8405a76aba4b4bc540c752beda6f1cfd4a4c
2018-04-13 21:51:33 -07:00
Mark Thomas
50792d83d8 hgsubversion: use new-style progress bars
Reviewed By: mjpieters

Differential Revision: D7329498

fbshipit-source-id: 138dcd425ceb6e8e35c134555bfb07c1680e5674
2018-04-13 21:51:33 -07:00
Mark Thomas
b46a47be82 hgsql: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329506

fbshipit-source-id: 3aa83389ace823cfc933a48076403ceda510387a
2018-04-13 21:51:33 -07:00
Mark Thomas
fd9fbe1f27 hggit: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329502

fbshipit-source-id: e12c77f511034ecedd521709523c3674c133d181
2018-04-13 21:51:33 -07:00
Mark Thomas
d28e778f85 fixcorrupt: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329520

fbshipit-source-id: fccd015d96ef608eb2cae534b6f991bd96bf83b2
2018-04-13 21:51:33 -07:00
Mark Thomas
77d4bc2b83 fbsparse: use new-style progress bars
Reviewed By: mjpieters

Differential Revision: D7329504

fbshipit-source-id: 8037f704f88ea8b7d02ef323932143298fef5c66
2018-04-13 21:51:33 -07:00
Mark Thomas
52d272277f fastannotate: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329490

fbshipit-source-id: 3c8bf8b0590b1d3e5bf567849de4b7c88ea8b894
2018-04-13 21:51:33 -07:00
Mark Thomas
eb318ffa63 convert: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329501

fbshipit-source-id: 5312f905b513200904c79acbdb1c7b17968a8aba
2018-04-13 21:51:33 -07:00
Mark Thomas
af359e3856 churn: use new-style progress bars
Reviewed By: quark-zju

Differential Revision: D7329481

fbshipit-source-id: 4bf764216e23c1e38efe19340eabd7a29f960e64
2018-04-13 21:51:33 -07:00
Mark Thomas
1575ac85e1 httpconnection: remove old-style progress bar
Summary:
httpconnection uses old-style progress bars in a way that isn't easy to
replicate using new-style progress bars.  Remove it for now, it can be added
back in later in the right place.

Reviewed By: quark-zju

Differential Revision: D7329486

fbshipit-source-id: 814c55d7a5bb5c97fc6b3967510ed656110038c8
2018-04-13 21:51:33 -07:00
Mark Thomas
fb4c6e652c verify: use new-style progress bars
Reviewed By: mjpieters

Differential Revision: D7329516

fbshipit-source-id: 4e18bd639f292c3dcb8b6c33f1322b85ed40c043
2018-04-13 21:51:33 -07:00
Mark Thomas
9d89d36068 verify: refactor _verifymanifests
Summary:
The recursive function _verifymanifests behaves differently for the root and
non-root manifests in treemanifest.  Split out the behaviour into separate
functions in preparation for reworking the progress bar to the new style.

Reviewed By: quark-zju

Differential Revision: D7329518

fbshipit-source-id: 4f499354060d7397a6a9781d15df26a0343c8fca
2018-04-13 21:51:33 -07:00
Mark Thomas
d5f068eebb upgrade: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329517

fbshipit-source-id: 66dc4a84c12967382e2e244fcff10fbdd8068777
2018-04-13 21:51:32 -07:00
Mark Thomas
9fe044b560 treediscovery: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329493

fbshipit-source-id: f7a4d9d38e6ac53e9d12fee1ad8300a3c7654d2c
2018-04-13 21:51:32 -07:00
Mark Thomas
e0ebeb5325 subrepo: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329515

fbshipit-source-id: d35a7e4a6ad9a78da9b74863b83811dd4e9f2e9e
2018-04-13 21:51:32 -07:00
Mark Thomas
7df8b26ee9 streamclone: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329478

fbshipit-source-id: 34ef05de908afd87a23cbaeb657e66a39af46b8b
2018-04-13 21:51:32 -07:00
Mark Thomas
a285514e0b similar: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329510

fbshipit-source-id: 296e2cbb5381088253eb138600b45a72bbcb3d84
2018-04-13 21:51:32 -07:00
Mark Thomas
6f72915069 setdiscovery: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329480

fbshipit-source-id: da4825435b32887daec71e30bc23aa3dc7c9696d
2018-04-13 21:51:32 -07:00
Mark Thomas
30460a0584 repair: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329514

fbshipit-source-id: d0a0792e1954a9cb895dccbb087f9cd921de3391
2018-04-13 21:51:32 -07:00
Mark Thomas
36531369fc merge: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329511

fbshipit-source-id: 73afeb70cf3cce35a290588bd1d8f57d09baf3f8
2018-04-13 21:51:32 -07:00
Mark Thomas
2640f4cf42 debugcommands: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329487

fbshipit-source-id: 74b4fabd62242556b04d29c3e8be40eeae444cc7
2018-04-13 21:51:32 -07:00
Mark Thomas
c13d19c577 cmdutil: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329499

fbshipit-source-id: 429fd5a7c1cbbfe4734f940b74a3333cb57af455
2018-04-13 21:51:32 -07:00
Mark Thomas
b475295681 changegroup: use new-style progress bars
Reviewed By: DurhamG

Differential Revision: D7329508

fbshipit-source-id: b887265f9ceb051d14706bfee8708bbd4c74557d
2018-04-13 21:51:32 -07:00
Mark Thomas
ded1a17e97 archiving: use new-style progress bars
Reviewed By: ryanmce

Differential Revision: D7329713

fbshipit-source-id: 49e6c17f7e54f6a728fc48cd6569ec1a7768cebe
2018-04-13 21:51:32 -07:00
Mark Thomas
f1508781f5 hg: use new-style progress bars for copystore
Summary:
Update hg.copystore and util.copyfiles to use the new-style progress bar
context manager.

Reviewed By: ryanmce

Differential Revision: D7329482

fbshipit-source-id: 4ac1def57e0ae4e7819c7c0c4d6f1715b8cbb625
2018-04-13 21:51:31 -07:00
Mark Thomas
f1ff6d7c4c progress: only update if value changes
Summary:
New-style progress bars should only update if there has been any progress since
the last refresh.  Otherwise, stalls in progress cause weird behaviour for time
estimates.

Reviewed By: DurhamG, quark-zju

Differential Revision: D7329494

fbshipit-source-id: 43b9fdd5573b34174673db838e53a0d54504eefd
2018-04-13 21:51:31 -07:00