Commit Graph

3602 Commits

Author SHA1 Message Date
Anna Kukliansky
885f172d83 dont define MIN if it is allready defined
Summary:
to overcome this error:
```
stderr: In file included from eden/scm/edenscm/mercurial/cext/osutil.c:44:
eden/scm/edenscm/mercurial/cext/util.h:39:9: error: 'MIN' macro redefined [-Werror,-Wmacro-redefined]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))

buck-out/dev/cells/fbsource/gen/03598924/xplat/toolchains/minimal_xcode/MacOSX11.1.sdk__/MacOSX11.1.sdk/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/sys/param.h:215:9: note: previous definition is here
#define MIN(a, b) (((a)<(b))?(a):(b))
```

Reviewed By: andrewjcg

Differential Revision: D27137302

fbshipit-source-id: c0ecdfe41e4f2215fb6b886a350d1e4e0224abd5
2021-03-18 04:09:20 -07:00
Anna Kukliansky
0f06f9a092 workaround const qualifier discard
Summary:
In regular xcode this was warning and being ignores. Not the working is handled as an error.
This diff is only a workaround so we wont get those errors .
```
eden/scm/edenscm/mercurial/cext/osutil.c:745:49: error: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  ret = _listdir_batch(path, pathlen, keepstat, skip, &fallback);
                                                ^~~~
eden/scm/edenscm/mercurial/cext/osutil.c:586:11: note: passing argument to parameter 'skip' here
    char* skip,
```

Reviewed By: mzlee

Differential Revision: D27136440

fbshipit-source-id: 00d61fd00e3ed8e23643ea69b5a82dbeb5e742ce
2021-03-18 02:38:56 -07:00
Jun Wu
9d71e83f99 smartlog: show obsoleted commit stack
Summary:
With `sl -r OBSOLETED` the intention is see the obsoleted stack instead of just
a single commit. So filter the "::heads" with "- public()", not "& draft()".

The goal is to deprecate `--hidden`. See the linked post for more context.

Reviewed By: DurhamG

Differential Revision: D27093425

fbshipit-source-id: 76e9650a809c1d94da2341e2aca31d349487610d
2021-03-17 23:23:07 -07:00
Arun Kulshreshtha
c51b647565 async-runtime: add spawn_blocking function
Summary: Add a simple wrapper around `tokio::runtime::Runtime:spawn_blocking`.

Reviewed By: quark-zju

Differential Revision: D27145094

fbshipit-source-id: 9575341dbfd90f169eba53f6c5ae2cc3e8b41c70
2021-03-17 19:23:00 -07:00
Durham Goode
4275cb5488 configs: stop creating .hg directories
Summary:
This creates .hg directories when there is no repository at all, which
breaks jf submit in git repos. D26801059 is the real fix, but it has some other
complications. Let's drop the creation here, since it really isn't necessary.

Reviewed By: quark-zju

Differential Revision: D27134087

fbshipit-source-id: d15048b2d1022d38393b62cc02ebf022e617ed4f
2021-03-17 13:14:32 -07:00
Jun Wu
17e9512f94 log: preserve prefetch information for log -r
Summary:
When using `log -r REVS` with filtering flags like `-u`, `-d`, preserve the
prefetch information by using the `revs(subset=subset)` API.

Reviewed By: sfilipco

Differential Revision: D27119174

fbshipit-source-id: 8483d7113cfc819c6053d1429221588c3a917c12
2021-03-17 11:02:16 -07:00
Jun Wu
b98bf3873f localrepo: add subset arguments to revs
Summary:
This allows specifying subsets. So we can rewrite:

  revs & repo.revs(expr)

to:

  repo.revs(expr, subset=revs)

The latter will apply prefetch tweaks on subset when evaluating the revset
expr, while the former will lose prefetch information.

There might be a way to make `revs & repo.revs(expr)` do the right thing
for pre-fetching, too. But that could be more complicated w.r.t `&` fast
paths, over fetching (?), etc. For now I just took the fix that looks more
obvious to me.

Reviewed By: sfilipco

Differential Revision: D27119175

fbshipit-source-id: 2629d21594cf97d7c0f63cf085a2c427d8782e58
2021-03-17 11:02:16 -07:00
Jun Wu
216363e15e smartset: show progress filtering commits
Summary:
The filteredset can often be expensive filtering commits like `hg log -u foo`,
`hg log -d '2010-1-1'`. Add a progress bar to show what's going on.

Reviewed By: sfilipco

Differential Revision: D27119176

fbshipit-source-id: 458fbf331978b26e78e6a85fb194ae8b12b949d6
2021-03-17 11:02:16 -07:00
Arun Kulshreshtha
4ced7f2e6d edenapi_types: implement ToJson for various commit requests
Summary:
`CommitHashToLocationRequestBatch` and `CommitRevlogDataRequest` implemented `FromJson` but not `ToJson`. The latter is required so that the EdenAPI client can log JSON representations of all request types.

In the process of adding tests for those two types, I discovered a bug in `CommitLocationToHashRequestBatch`'s `ToJson` implementation which prevented it from passing JSON roundtrip tests (which I added because this type didn't have test coverage here). The bug is now fixed and the roundtrip test passes.

Reviewed By: krallin

Differential Revision: D27105414

fbshipit-source-id: d2e23e21f996ac8062bca948ed9abe3779e4669d
2021-03-17 10:57:48 -07:00
Arun Kulshreshtha
8686c15a53 edenapi_types: implement quickcheck::Arbitrary for CommitRevlogDataRequest
Summary: Used in next diff.

Reviewed By: krallin

Differential Revision: D27105415

fbshipit-source-id: f93990bff2c8a8bcc1293ec7db4c87f34e3b8d2e
2021-03-17 10:57:48 -07:00
Arun Kulshreshtha
ad02212fce edenapi_types: use macro for JSON rountrip quickcheck tests
Summary: Use a macro to define quickcheck tests that perform roundtrip conversions for EdenAPI types that implement `ToJson` and `FromJson`. This makes it easier to add additional roundtrip tests for new types.

Reviewed By: krallin

Differential Revision: D27105416

fbshipit-source-id: c6059f9527d57b88cd6e3d1647fa89d8f826b1e3
2021-03-17 10:57:48 -07:00
Chad Austin
e05a6575b3 editmerge editor selection consistency
Summary:
editmerge did not follow the same editor fallback described in
https://www.mercurial-scm.org/wiki/HGEDITOR and `hg help
environment`. Make the fallback behavior (especially to `vi` if none
are set) consistent by defining HGEDITOR before invoking external
merge scripts.

Reviewed By: farnz

Differential Revision: D27104830

fbshipit-source-id: 0ca657578f010a682afb84649f2f18ff46046864
2021-03-17 10:48:36 -07:00
Jun Wu
667c6a1274 io: improve mixed stdout + stderr progress output behavior
Summary:
Rework the progress. Always move the cursor to the top-left corner of the
progress output. So the clear progress instruction is just to erase till
the end of the screen. There is no need to track the height of the progress.

Update flush logic so we only do flush when crossing the progress/non-progress
boundary: When we write progress (to stderr), flush stdout, write progress,
then flush stderr.

Also, disable progress unconditionally if the current output line is incomplete.

Reviewed By: sfilipco

Differential Revision: D27109228

fbshipit-source-id: 717345e9c7eaeebeb378ce090f7b2f60957fd150
2021-03-17 09:27:51 -07:00
Jun Wu
985939bc25 io: do not write to output for write_err
Summary: This makes write_err() consistent with error().write().

Reviewed By: sfilipco

Differential Revision: D27109227

fbshipit-source-id: 4e7ea1fe464c17548c34e5f9bf78085868a20256
2021-03-17 09:27:51 -07:00
Jun Wu
acbb9ee8d3 commandserver: remove a debug output
Summary:
See the previous diff. This avoids complex logic in the signal handler so we
don't need to think about whether the complex logic is reentrant or not.

Reviewed By: DurhamG

Differential Revision: D27111183

fbshipit-source-id: 110ef5699d5fcd007f8399e90443bb406e2b173c
2021-03-17 08:30:27 -07:00
Jun Wu
c0c4d0b22c tracing-runtime-callsite: fix a potential deadlock
Summary:
This can cause a deadlock if `func()` calls `create_callsite`.

Usually it's rare. But (Python) signal handler makes it realistic.

Example backtrace:

  Traceback (most recent call first):
    File "/opt/fb/mercurial/edenscm/tracing.py", line 337, in event
    File "/opt/fb/mercurial/edenscm/mercurial/ui.py", line 1275, in debug
      tracing.debug(msg.rstrip("\n"), depth=1)
    File "/opt/fb/mercurial/edenscm/mercurial/commandserver.py", line 608, in _reapworkers
      self.ui.debug("worker process exited (pid=%d)\n" % pid)
    File "/opt/fb/mercurial/edenscm/mercurial/commandserver.py", line 591, in _sigchldhandler
      self._reapworkers(os.WNOHANG)
    File "/opt/fb/mercurial/edenscm/tracing.py", line 337, in event
    File "/opt/fb/mercurial/edenscm/mercurial/ui.py", line 1275, in debug
      tracing.debug(msg.rstrip("\n"), depth=1)
    File "/opt/fb/mercurial/edenscm/mercurial/commandserver.py", line 608, in _reapworkers
      self.ui.debug("worker process exited (pid=%d)\n" % pid)
    File "/opt/fb/mercurial/edenscm/mercurial/commandserver.py", line 591, in _sigchldhandler
      self._reapworkers(os.WNOHANG)

  #0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  #1  0x000055d0d65ba339 in <parking_lot::raw_rwlock::RawRwLock>::lock_upgradable_slow ()
  #2  0x000055d0d55b5814 in tracing_runtime_callsite::create_callsite::<tracing_runtime_callsite::callsite_info::EventKindType, pytracing::new_callsite<tracing_runtime_callsite::callsite_info::EventKindType>::{closure#2}> ()
  #3  0x000055d0d5584cb9 in <pytracing::EventCallsite>::__new__ ()
  #4  0x000055d0d55a3eaa in std::panicking::try::<*mut python3_sys::object::PyObject, cpython::function::handle_callback<<pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc::{closure#0}, pytracing::EventCallsite, cpython::function::PyObjectCallbackConverter>::{closure#0}> ()
  #5  0x000055d0d5589365 in cpython::function::handle_callback::<<pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc::{closure#0}, pytracing::EventCallsite, cpython::function::PyObjectCallbackConverter> ()
  #6  0x000055d0d55856e1 in <pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc ()
  #7  0x00007ff88d576230 in type_call (
      kwds={'obj': Frame 0x7ff87c1f8c40, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87d...(truncated), args=(),
      type=0x55d0d8ea5b40 <_RNvNvMs1R_CsgCrAUYYhx1D_9pytracingNtB8_13EventCallsite15create_instance11TYPE_OBJECT.llvm.4665269759137401160>) at Objects/typeobject.c:974
  #8  _PyObject_MakeTpCall (callable=<type at remote 0x55d0d8ea5b40>, args=<optimized out>,
      nargs=<optimized out>, keywords=<optimized out>) at Objects/call.c:159
  #9  0x00007ff88d56dc81 in _PyObject_Vectorcall (
      kwnames=('obj', 'name', 'target', 'level', 'fieldnames'), nargsf=<optimized out>,
      args=<optimized out>, callable=<type at remote 0x55d0d8ea5b40>) at ./Include/cpython/abstract.h:125
  #10 _PyObject_Vectorcall (kwnames=('obj', 'name', 'target', 'level', 'fieldnames'),
      nargsf=<optimized out>, args=<optimized out>, callable=<type at remote 0x55d0d8ea5b40>)
      at ./Include/cpython/abstract.h:115
  #11 call_function (kwnames=('obj', 'name', 'target', 'level', 'fieldnames'), oparg=<optimized out>,
      pp_stack=<synthetic pointer>, tstate=<optimized out>) at Python/ceval.c:4963
  #12 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3515
  #13 0x00007ff88d566268 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87cced010, for file /opt/fb/mercurial/edenscm/tracing.py, line 337, in event (message='worker process exited (pid=3953080)', name=None, target=None, level=1, depth=1, meta={}, frame=Frame 0x7ff87c1f8c40, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': ...(truncated))
      at Python/ceval.c:741
  #14 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>,
      args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x7ff87c0fdc78,
      kwcount=<optimized out>, kwstep=1, defs=0x7ff87d572558, defcount=4, kwdefs=0x0, closure=0x0,
      name='event', qualname='event') at Python/ceval.c:4298
  #15 0x00007ff88d57fdce in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7ff87c0fdc70,
      nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:435
  #16 0x00007ff88d57574f in _PyObject_FastCallDict (callable=<function at remote 0x7ff87d5741f0>,
      args=0x7ff87eb63838, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:104
  #17 0x00007ff88d66d1ab in partial_fastcall (kwargs={'level': 1, 'depth': 1}, nargs=<optimized out>,
      args=<optimized out>, pto=0x7ff87d572630) at ./Modules/_functoolsmodule.c:169
  #18 partial_call (pto=0x7ff87d572630, args=<optimized out>, kwargs=<optimized out>)
      at ./Modules/_functoolsmodule.c:224
  #19 0x00007ff88d576331 in _PyObject_MakeTpCall (callable=<functools.partial at remote 0x7ff87d572630>,
      args=<optimized out>, nargs=<optimized out>, keywords=<optimized out>) at Objects/object.c:2207
  #20 0x00007ff88d56dc81 in _PyObject_Vectorcall (kwnames=('depth',), nargsf=<optimized out>,
      args=<optimized out>, callable=<functools.partial at remote 0x7ff87d572630>)
      at ./Include/cpython/abstract.h:125
  #21 _PyObject_Vectorcall (kwnames=('depth',), nargsf=<optimized out>, args=<optimized out>,
      callable=<functools.partial at remote 0x7ff87d572630>) at ./Include/cpython/abstract.h:115
  #22 call_function (kwnames=('depth',), oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=<optimized out>) at Python/ceval.c:4963
  #23 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3515
  #24 0x00007ff88d566268 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c0e43c0, for file /opt/fb/mercurial/edenscm/mercurial/ui.py, line 1275, in debug (self=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a0>, 'bookmarks': <itemregister(_generics=se...(truncated))
      at Python/ceval.c:741
  #25 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>,
      args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x7ff87c1f8de8,
      kwcount=<optimized out>, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name='debug',
      qualname='ui.debug') at Python/ceval.c:4298
  #26 0x00007ff88d57fdce in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7ff87c1f8dd8,
      nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:435
  #27 0x00007ff88d56821a in _PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>,
      args=0x7ff87c1f8dd8, callable=<function at remote 0x7ff87d57e9d0>)
      at ./Include/cpython/abstract.h:127
  #28 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=0x7ff88ca08780) at Python/ceval.c:4963
  #29 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3486
  #30 0x00007ff88d57fd38 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c1f8c40, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a0>,...(truncated))
      at Python/ceval.c:738
  #31 function_code_fastcall (globals=<optimized out>, nargs=2, args=<optimized out>, co=<optimized out>)
      at Objects/call.c:283
  #32 _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/call.c:410
  #33 0x00007ff88d56821a in _PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>,
      args=0x7ff87c0f26d8, callable=<function at remote 0x7ff87d73b310>)
      at ./Include/cpython/abstract.h:127
  #34 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=0x7ff88ca08780) at Python/ceval.c:4963
  #35 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3486
  #36 0x00007ff88d57fd38 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c0f2550, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 591, in _sigchldhandler (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemreg
  ister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a...(truncated))
      at Python/ceval.c:738
  #37 function_code_fastcall (globals=<optimized out>, nargs=3, args=<optimized out>, co=<optimized out>)
      at Objects/call.c:283
  #38 _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/call.c:410
  #39 0x00007ff88d592153 in _PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>,
      args=<optimized out>, callable=<optimized out>) at ./Include/cpython/abstract.h:115
  #40 method_vectorcall (method=<optimized out>, args=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/classobject.c:67
  #41 0x00007ff88d5963fb in PyVectorcall_Call (kwargs=0x0, tuple=<optimized out>,
      callable=<method at remote 0x7ff87c70d5c0>) at Objects/dictobject.c:1802
  #42 PyObject_Call (callable=<method at remote 0x7ff87c70d5c0>, args=<optimized out>, kwargs=0x0)
      at Objects/call.c:227
  #43 0x00007ff88d6405ea in _PyErr_CheckSignals () at ./Modules/signalmodule.c:1689
  #44 0x00007ff88d5a41a1 in _PyErr_CheckSignals () at Objects/object.c:577
  #45 PyErr_CheckSignals () at ./Modules/signalmodule.c:1649
  #46 PyObject_Str (v='_reapworkers') at Objects/object.c:561
  #47 0x000055d0d557c821 in pytracing::tostr_opt ()
  #48 0x000055d0d55b5a7d in tracing_runtime_callsite::create_callsite::<tracing_runtime_callsite::callsite_info::EventKindType, pytracing::new_callsite<tracing_runtime_callsite::callsite_info::EventKindType>::{closure#2}> ()
  #49 0x000055d0d5584cb9 in <pytracing::EventCallsite>::__new__ ()
  #50 0x000055d0d55a3eaa in std::panicking::try::<*mut python3_sys::object::PyObject, cpython::function::handle_callback<<pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc::{closure#0}, pytracing::EventCallsite, cpython::function::PyObjectCallbackConverter>::{closure#0}> ()
  #51 0x000055d0d5589365 in cpython::function::handle_callback::<<pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc::{closure#0}, pytracing::EventCallsite, cpython::function::PyObjectCallbackConverter> ()
  #52 0x000055d0d55856e1 in <pytracing::EventCallsite>::create_instance::TYPE_OBJECT::wrap_newfunc ()
  #53 0x00007ff88d576230 in type_call (
      kwds={'obj': Frame 0x7ff87c1f8440, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87d...(truncated), args=(),
      type=0x55d0d8ea5b40 <_RNvNvMs1R_CsgCrAUYYhx1D_9pytracingNtB8_13EventCallsite15create_instance11TYPE_OBJECT.llvm.4665269759137401160>) at Objects/typeobject.c:974
  #54 _PyObject_MakeTpCall (callable=<type at remote 0x55d0d8ea5b40>, args=<optimized out>,
      nargs=<optimized out>, keywords=<optimized out>) at Objects/call.c:159
  #55 0x00007ff88d56dc81 in _PyObject_Vectorcall (
      kwnames=('obj', 'name', 'target', 'level', 'fieldnames'), nargsf=<optimized out>,
      args=<optimized out>, callable=<type at remote 0x55d0d8ea5b40>) at ./Include/cpython/abstract.h:125
  #56 _PyObject_Vectorcall (kwnames=('obj', 'name', 'target', 'level', 'fieldnames'),
      nargsf=<optimized out>, args=<optimized out>, callable=<type at remote 0x55d0d8ea5b40>)
      at ./Include/cpython/abstract.h:115
  #57 call_function (kwnames=('obj', 'name', 'target', 'level', 'fieldnames'), oparg=<optimized out>,
      pp_stack=<synthetic pointer>, tstate=<optimized out>) at Python/ceval.c:4963
  #58 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3515
  #59 0x00007ff88d566268 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87ccec890, for file /opt/fb/mercurial/edenscm/tracing.py, line 337, in event (message='worker process exited (pid=3953122)', name=None, target=None, level=1, depth=1, meta={}, frame=Frame 0x7ff87c1f8440, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _u
  nserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': ...(truncated))
      at Python/ceval.c:741
  #60 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>,
      args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x7ff87c0fdd78,
      kwcount=<optimized out>, kwstep=1, defs=0x7ff87d572558, defcount=4, kwdefs=0x0, closure=0x0,
      name='event', qualname='event') at Python/ceval.c:4298
  #61 0x00007ff88d57fdce in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7ff87c0fdd70,
      nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:435
  #62 0x00007ff88d57574f in _PyObject_FastCallDict (callable=<function at remote 0x7ff87d5741f0>,
      args=0x7ff87eb59d18, nargsf=<optimized out>, kwargs=<optimized out>) at Objects/call.c:104
  #63 0x00007ff88d66d1ab in partial_fastcall (kwargs={'level': 1, 'depth': 1}, nargs=<optimized out>,
      args=<optimized out>, pto=0x7ff87d572630) at ./Modules/_functoolsmodule.c:169
  #64 partial_call (pto=0x7ff87d572630, args=<optimized out>, kwargs=<optimized out>)
      at ./Modules/_functoolsmodule.c:224
  #65 0x00007ff88d576331 in _PyObject_MakeTpCall (callable=<functools.partial at remote 0x7ff87d572630>,
      args=<optimized out>, nargs=<optimized out>, keywords=<optimized out>) at Objects/object.c:2207
  #66 0x00007ff88d56dc81 in _PyObject_Vectorcall (kwnames=('depth',), nargsf=<optimized out>,
      args=<optimized out>, callable=<functools.partial at remote 0x7ff87d572630>)
      at ./Include/cpython/abstract.h:125
  #67 _PyObject_Vectorcall (kwnames=('depth',), nargsf=<optimized out>, args=<optimized out>,
      callable=<functools.partial at remote 0x7ff87d572630>) at ./Include/cpython/abstract.h:115
  #68 call_function (kwnames=('depth',), oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=<optimized out>) at Python/ceval.c:4963
  #69 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3515
  #70 0x00007ff88d566268 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c0e4200, for file /opt/fb/mercurial/edenscm/mercurial/ui.py, line 1275, in debug (self=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a0>, 'bookmarks': <itemregister(_generics=se...(truncated))
      at Python/ceval.c:741
  #71 _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>,
      args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>, kwargs=0x7ff87c1f85e8,
      kwcount=<optimized out>, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name='debug',
      qualname='ui.debug') at Python/ceval.c:4298
  #72 0x00007ff88d57fdce in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7ff87c1f85d8,
      nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:435
  #73 0x00007ff88d56821a in _PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>,
      args=0x7ff87c1f85d8, callable=<function at remote 0x7ff87d57e9d0>)
      at ./Include/cpython/abstract.h:127
  #74 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=0x7ff88ca08780) at Python/ceval.c:4963
  #75 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3486
  #76 0x00007ff88d57fd38 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c1f8440, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 608, in _reapworkers (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a0>,...(truncated))
      at Python/ceval.c:738
  #77 function_code_fastcall (globals=<optimized out>, nargs=2, args=<optimized out>, co=<optimized out>)
  {<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a0>,...(truncated))
      at Python/ceval.c:738
  #77 function_code_fastcall (globals=<optimized out>, nargs=2, args=<optimized out>, co=<optimized out>)
  --Type <RET> for more, q to quit, c to continue without paging--
      at Objects/call.c:283
  #78 _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/call.c:410
  #79 0x00007ff88d56821a in _PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>,
      args=0x7ff87c0f2528, callable=<function at remote 0x7ff87d73b310>)
      at ./Include/cpython/abstract.h:127
  #80 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>,
      tstate=0x7ff88ca08780) at Python/ceval.c:4963
  #81 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3486
  #82 0x00007ff88d57fd38 in PyEval_EvalFrameEx (throwflag=0,
      f=Frame 0x7ff87c0f23a0, for file /opt/fb/mercurial/edenscm/mercurial/commandserver.py, line 591, in _sigchldhandler (self=<unixforkingservice(ui=<ui(_buffers=[], _bufferstates=[], _bufferapplylabels=None, _outputui=None, callhooks=True, insecureconnections=False, _colormode=None, _styles={}, _terminaloutput=None, cmdname=None, _uiconfig=<uiconfig(quiet=False, verbose=False, debugflag=False, tracebackflag=False, logmeasuredtimes=False, _rcfg=<localrcfg(_rcfg=<bindings.configparser.config at remote 0x7ff87d7325d0>) at remote 0x7ff87eb73e80>, _unserializable={}, _pinnedconfigs=set(), _knownconfig={'alias': <itemregister(_generics={<configitem(section='alias', name='.*', default=None, alias=[], generic=True, priority=0, _re=<re.Pattern at remote 0x7ff87d69bed0>) at remote 0x7ff87d690a60>}) at remote 0x7ff87dbfde50>, 'annotate': <itemregister(_generics=set()) at remote 0x7ff87d6ad9f0>, 'auth': <itemregister(_generics=set()) at remote 0x7ff87dc037c0>, 'blackbox': <itemregister(_generics=set()) at remote 0x7ff87dc039a...(truncated))
      at Python/ceval.c:738
  #83 function_code_fastcall (globals=<optimized out>, nargs=3, args=<optimized out>, co=<optimized out>)
      at Objects/call.c:283
  #84 _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/call.c:410
  #85 0x00007ff88d592153 in _PyObject_Vectorcall (kwnames=<optimized out>, nargsf=<optimized out>,
      args=<optimized out>, callable=<optimized out>) at ./Include/cpython/abstract.h:115
  #86 method_vectorcall (method=<optimized out>, args=<optimized out>, nargsf=<optimized out>,
      kwnames=<optimized out>) at Objects/classobject.c:67
  #87 0x00007ff88d5963fb in PyVectorcall_Call (kwargs=0x0, tuple=<optimized out>,
      callable=<method at remote 0x7ff87c70d5c0>) at Objects/dictobject.c:1802
  #88 PyObject_Call (callable=<method at remote 0x7ff87c70d5c0>, args=<optimized out>, kwargs=0x0)
      at Objects/call.c:227
  #89 0x00007ff88d6405ea in _PyErr_CheckSignals () at ./Modules/signalmodule.c:1689
  #90 0x00007ff88d59b7fd in _PyErr_CheckSignals () at ./Modules/signalmodule.c:1660
  #91 PyErr_CheckSignals () at ./Modules/signalmodule.c:1649
  ....

Reviewed By: DurhamG

Differential Revision: D27111187

fbshipit-source-id: 1aa29ab24088b57b98de3741eb81c0a7be01237d
2021-03-17 08:30:27 -07:00
generatedunixname89002005287564
acee496fa8 Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D27114089

fbshipit-source-id: 2bad79f50ca4389748f6bcbed57401af7cd9f555
2021-03-17 04:26:37 -07:00
Liubov Dmitrieva
d687360349 display remote bookmarks that are in smartlog
Summary: display remote bookmarks that belongs to existing nodes in commit cloud smartlog

Reviewed By: krallin

Differential Revision: D27048074

fbshipit-source-id: 85d2a5bbf2e0c50cc28ca3e29f6b98b1d848cda2
2021-03-17 03:36:15 -07:00
Durham Goode
7ba5270539 tests: make test-debugdynamicconfig.t more robust
Summary: The zz could match temporary file names on Windows. Let's add the _ to make it more unlikely to match temp files.

Reviewed By: quark-zju

Differential Revision: D27100451

fbshipit-source-id: 5646bb2ad1e52b1f49c29729d424111601468c69
2021-03-16 22:23:40 -07:00
Chad Austin
6defcfe9d6 shelve: remove buck warning from shelve and unshelve
Summary:
Now that EdenFS and Watchman are compatible with hg shelve and other
rapid commit changes, this warning is no longer necessary.

This backs out D25337932 (c1659751c9).

Reviewed By: quark-zju

Differential Revision: D27095024

fbshipit-source-id: 31af1d2dafaa0f340a4ace10a16f9357ed84dbf0
2021-03-16 20:33:19 -07:00
generatedunixname89002005307016
0d67ab076a suppress errors in fbcode/eden - batch 1
Differential Revision: D27082204

fbshipit-source-id: b1d1562878ff55cf464c336aec02f8501967c60e
2021-03-16 17:32:09 -07:00
Jun Wu
e5f2a6b8ce localrepo: flush changelog before remotenames
Summary:
Currently it has write order issues:

  > hg pull
  searching for changes
  adding commits
  adding manifests
  adding file changes
  added 76503 commits with 0 changes to 0 files
  memory allocation of 369697160 bytes failed

  > hg up master
  abort: unknown revision 'master'!

Fix it by writing changelog first.

Reviewed By: DurhamG

Differential Revision: D27066479

fbshipit-source-id: 496319db2ce512a448af8a4e97db75211e2e97a6
2021-03-16 16:34:40 -07:00
Arun Kulshreshtha
a7f610e683 edenapi: remove no-op collect
Summary: This line just collects a vector into a vector. Probably a remnant of a refactor. Delete it.

Reviewed By: quark-zju

Differential Revision: D27091643

fbshipit-source-id: fb611aabea375b8495476401b2d9cdf7ba12fde1
2021-03-16 15:45:49 -07:00
Andrew Gallagher
fdf9827efb Remove dead get_build_rule_output_path() calls
Summary:
These appear to have been made effectively dead by cleanup in D25313325 (23daa7f90f).

This is part of unblocking the hashed buck-out rollout effort
(https://fb.prod.workplace.com/groups/fbcode.fyi/permalink/3694589863910121/),
as `get_build_rule_output_path()` relies on hard-coded buck-out paths.

Reviewed By: mzlee

Differential Revision: D27072131

fbshipit-source-id: 4fccee06a73c4afbf89cb737b25e1713a1afc55a
2021-03-16 14:23:31 -07:00
Jun Wu
59b8287c85 indexedlog: be compatible with MultiLog changes written by older software
Summary: This makes the new software respects writes by older software.

Differential Revision: D27093942

fbshipit-source-id: 097b57c61b5ee1f0264babb88737306113fe356a
2021-03-16 13:59:21 -07:00
Andrey Chursin
a43d7c5029 checkout: log when native checkout is used to scuba
Reviewed By: DurhamG

Differential Revision: D27064447

fbshipit-source-id: aabb79657e6e48779126733d0ab2b326c91e807e
2021-03-15 21:58:48 -07:00
Jun Wu
f2ed2600d2 test-sparse-fetch: improve robustness
Summary:
`hg stauts` can be "indeterministic" because of the last second mtime fix
special rule (see pytreestate/src/lib.rs:invalidatemtime).
The test sometimes fails like:

  test-sparse-fetch-t.py:140: [] != ['x', 'x/x']

Update it to support both `[]` and `['x', 'x/x']` case.

Reviewed By: sfilipco

Differential Revision: D27071225

fbshipit-source-id: c413906897b408c1e85912852afed1717a87ffc9
2021-03-15 20:04:54 -07:00
Jun Wu
b8fa495ea8 indexedlog: make finalize_indexes report more detailed error
Summary:
The error was triggered but it's unclear what's wrong. Make the error
more detailed.

Reviewed By: xavierd

Differential Revision: D27058212

fbshipit-source-id: 3f6220e2d100d9118c05a8b4c75c5ba19c9181db
2021-03-15 18:49:16 -07:00
Jun Wu
e312b57623 doctor: repair segmented changelog
Summary: Add repair logic for segmented changelog.

Reviewed By: sfilipco

Differential Revision: D27057695

fbshipit-source-id: 2c1c367ce161e830219f449993fbf371f9330f16
2021-03-15 18:45:07 -07:00
Jun Wu
b573e1b866 pydag: add API to repair NameDag
Summary: This will be used by `doctor` command.

Reviewed By: sfilipco

Differential Revision: D27053349

fbshipit-source-id: bc33e25997f30107f919a090ff68693bfdd7199d
2021-03-15 18:45:07 -07:00
Jun Wu
a904d5606d dag: move MultiLog OpenOptions to a DefaultOpenOptions
Summary:
By implementing DefaultOpenOptions, indexedlog provides `repair()` for free.

Re-export the `Repair` trait so other crates can use `repair()` without
importing indexedlog.

Reviewed By: sfilipco

Differential Revision: D27053352

fbshipit-source-id: 8fa952f0e51e007b9d348bc12699ef1d65000c6b
2021-03-15 18:45:07 -07:00
Jun Wu
6e85ede2c1 indexedlog: implement repair for MultiLog
Summary:
With the new log for MultiMeta. It's now possible to repair a MultiLog by:
- Repair all Logs
- Scanning through the MultiMeta Log and find a valid MultiMeta.
- Set the current MultiMeta to the picked MultiMeta.

Reviewed By: sfilipco

Differential Revision: D27053346

fbshipit-source-id: d60596fb00323b3bcadd5ade2e34cad29a37d64a
2021-03-15 18:45:07 -07:00
Jun Wu
f2f7d49a0a indexedlog: make a few APIs crate visible
Summary: They will be used later.

Reviewed By: sfilipco

Differential Revision: D27053348

fbshipit-source-id: 85b534873a4470532cde1f2b201469a034f08d55
2021-03-15 18:45:07 -07:00
Jun Wu
568ad7a7cb indexedlog: track multilog meta in a separate log
Summary:
We recently saw a few reports about "multimeta" being 0-sized. MultiLog cannot
be repaired like other logs because the logs (ex. IdDag and IdMap) have to be
in sync. To implement Repair for MultiLog, let's track MultiMeta in a Log so
we can check its previous entries and fix the multimeta.

Reviewed By: sfilipco

Differential Revision: D27053347

fbshipit-source-id: af99b13d658ee62bfe63973ab9d37338d14a7d4a
2021-03-15 18:45:06 -07:00
Jun Wu
7eea44ce4e test-doctor: improve robustness
Summary:
The test failed sometimes on Linux:

    --- test-doctor.t
    +++ test-doctor.t.err
    @@ -204,11 +204,11 @@
       M A2
       A A0
         A
    -  A X
       R A
       R A1
       ? B
       ? C
    +  ? X
       ? Y
       ? Z

The treestate fix appears to rollback to even a previous version, which is also
a valid fix. Let's accept that state too.

Reviewed By: DurhamG

Differential Revision: D27064825

fbshipit-source-id: 6aab04e66ad14ad651f93805c9652c7423178665
2021-03-15 18:22:50 -07:00
Jun Wu
c554c56494 test-fb-hgext-fastlog: improve robustness
Summary:
The test failed sometimes on OSX:

    --- test-fb-hgext-fastlog.t
    +++ test-fb-hgext-fastlog.t.err
    @@ -34,6 +34,7 @@
       $ hg log dir -T '{desc}\n'
       b
       a
    +  Exception in thread Thread-3 (most likely raised during interpreter shutdown): (no-eol)
       $ hg log dir -T '{desc}\n' --all
       b
       a2

The threading usage in fastlog does seem kind of risky (especially with async
Rust involved). Race condition in Py_Finalize is not at all fun. Let's just
make the test more robust for now. In the future we probably want to avoid
threading in fastlog.

Reviewed By: DurhamG

Differential Revision: D27064618

fbshipit-source-id: a6c2ee5eda0fbd5120c8b5e5cfcc7af0f158f9b9
2021-03-15 18:22:50 -07:00
Jun Wu
a4912b15c7 tests: fix flakiness of test-fb-hgext-remotefilelog-repack-remove-old.t
Summary:
The test is failing:

    --- test-fb-hgext-remotefilelog-repack-remove-old.t
    +++ test-fb-hgext-remotefilelog-repack-remove-old.t.err
    @@ -63,7 +63,7 @@
       -r--r--r--      80 *.datapack (glob)
       -r--r--r--      80 *.datapack (glob)
       -r--r--r--      80 *.datapack (glob)
    -  -r--r--r--     144 *.datapack (glob)
    +  -r--r--r--      80 ef52660a201e447b43868610b08c72e22067b8b2.datapack

We are migrating away from repack so I just made the test pass without
investigating what's going on exactly.

Reviewed By: sfilipco

Differential Revision: D27064249

fbshipit-source-id: 6bcd583b6ecbe0b373d9fec2b23269b0da6a27f3
2021-03-15 16:00:20 -07:00
Jun Wu
ffb23d32a3 dag: make Debug<Segment>::fmt print invalid segments
Summary: This makes it easier to spot problematic segments.

Differential Revision: D27025039

fbshipit-source-id: 44ae9eaf03ca54751b64c0cf977b78737eaa58f0
2021-03-12 17:23:48 -08:00
Jun Wu
062c21d4d8 destutil: exclude null in histedit rev selection
Summary: The Rust commit graph does not hardcode nullid. This avoids crashes in some cases.

Differential Revision: D27022659

fbshipit-source-id: 0f61ffd9da89de7a477470384c6015d9edfaaaa0
2021-03-12 17:14:17 -08:00
Jun Wu
ea61594e04 dag: add some validations about segment parents
Summary:
We saw the `unwrap()` panic at `iddag.rs:453`:

  let (new_idx, low, high, parent_count, has_root) = candidate.unwrap();

Reading the code, it seems it can only happen if one of `parents` is `high` in a segment.
Parents in a segment should all be < low.  Add some validations for that.

Reviewed By: sfilipco

Differential Revision: D27021394

fbshipit-source-id: 2c51713dfb8f07f2921229d8866f7e8a0bd9490f
2021-03-12 13:02:50 -08:00
Jun Wu
3525a5b1e3 io: do not clear progress if stdout is redirected
Summary:
For example, `hg log > a.txt`, writing to `a.txt` does not need to clear the
progress bars.

Reviewed By: andll

Differential Revision: D26886281

fbshipit-source-id: 392c50e62a854e03ea0c400a1dac8bfb900815a2
2021-03-12 11:39:10 -08:00
Jun Wu
d76c91096a hgcommands: drop indicatif progress bar
Summary:
The Rust progress bars now integrates with hg-http and all requests get
progress bars for free. There is no need for a separate bar.

Reviewed By: andll

Differential Revision: D26970747

fbshipit-source-id: c5e59c745e75a93e5da0541baab21c3f23dc1322
2021-03-12 11:39:10 -08:00
Jun Wu
be8e45cdd1 hgcommands: support Rust progress
Summary:
Render the progress bars in a Rust thread.
Also make it compatible with traditional Python progress bars (not the most efficient way because the Python still have its own progress thread, but the code change is minimal).

Reviewed By: andll

Differential Revision: D26886282

fbshipit-source-id: ad1f862ced278cc1cb90c37f576eb05f52a50b13
2021-03-12 11:39:10 -08:00
Jun Wu
f561d3b862 streams: increase commit text batch size to 10k
Summary: 100 and 5k seems too small - requests are too frequent.

Reviewed By: andll

Differential Revision: D26886276

fbshipit-source-id: cb5cce1111120f8a437fbc8c60906940588f38bc
2021-03-12 11:39:09 -08:00
Jun Wu
a7c3458c82 clidispatch: split dispatch() method
Summary:
Split `dispatch()` into 2 parts: config parsing and command execution.
This allows callsite to do extra work based on the config before running the
command.

Reviewed By: andll

Differential Revision: D26853749

fbshipit-source-id: 459918b43341f7e14df6958056b6e07453bb691b
2021-03-12 11:39:09 -08:00
Andrew Gallagher
44feabdeaf Codemod away get_build_rule_output_path()
Summary:
This uses the codemod tool from D26980571 to port uses of deprecated
`get_build_rule_output_path()` (https://www.internalfb.com/intern/wiki/Buck-users/buildoutput-paths/)
to resources (https://fburl.com/python-resources).

This is part of unblocking the hashed buck-out rollout effort
(https://fb.prod.workplace.com/groups/fbcode.fyi/permalink/3694589863910121/),
as `get_build_rule_output_path()` relies on hard-coded buck-out paths.

Reviewed By: aniketmathur

Differential Revision: D26981028

fbshipit-source-id: d8cc70a2df3167d9e1961efa530ca639131f45fa
2021-03-12 09:09:02 -08:00
Andrey Chursin
e1ce22be1e async-runtime: introduce (try_)block_unless_interrupted
Summary: This method should be preferred to use from python binding. It is similar to block_on but allow to interrupt future on Ctrl+C

Reviewed By: quark-zju

Differential Revision: D26894586

fbshipit-source-id: 02d8fbb2f9c4d9e585f8fbee51bfc400c402d0d2
2021-03-12 09:04:04 -08:00
Andrey Chursin
6ed54d0317 checkout: switch to Bytes::to_vec since it is fixed now
Summary: See removed comment for detals

Reviewed By: quark-zju

Differential Revision: D26966487

fbshipit-source-id: 600c73fdec22180d7814608ecf1c3c9354fee5a1
2021-03-12 09:04:04 -08:00
Andrey Chursin
b67b2f21e1 checkout: handle sparse profile change file duplication
Summary:
During sparse profile change, there might be a case when file has changed between checkouts, and also is added due to sparse profile change

Currently this would lead to creating duplicated update action that would waste resources. This diff deduplicates such action

Reviewed By: quark-zju

Differential Revision: D26953657

fbshipit-source-id: ccd9084cc3984ac0692ee6178fce018a94cd56e7
2021-03-12 09:04:03 -08:00
Andrey Chursin
1e6ed3059c checkout: strip metadata from value returned by storage
Summary:
Current store implementation returns value that may contain matadata.
We need to strip it before writing out file to disk

This is not going to be a problem with new Eden API, but it is not erady yet and rolling it out may take time
So in order to start testing native checkout now, we are incorporating metadata removal in the checkout code

Reviewed By: quark-zju

Differential Revision: D26953658

fbshipit-source-id: 05d8be55bb96e7c3162594498ef0b9944b422c90
2021-03-12 09:04:03 -08:00