Commit Graph

1158 Commits

Author SHA1 Message Date
Andrey Chursin
261e309caf checkout: handle --clean in native checkout
Summary: Currently native checkout aborts on unknown files even with --clean flag. It should not abort with --clean

Reviewed By: DurhamG

Differential Revision: D27779554

fbshipit-source-id: 2badc84c10eab28d2b1fc8840142ef883ac48c26
2021-04-15 09:26:12 -07:00
Durham Goode
f0f6a38fbe dynamicconfig: backout D26801059 that enabled no-repo configs
Summary: This seems to have broken the EdenFS HgPrefetch test.

Reviewed By: xavierd

Differential Revision: D27795192

fbshipit-source-id: 80a748036961aa6a5750182bf65637fb76825341
2021-04-15 09:00:19 -07:00
Durham Goode
4803877dde dynamicconfig: generate dynamicconfigs when there's no repo
Summary:
Previously we'd skip dynamicconfigs when there wasn't a repo available.
Now that dynamicconfig can represent the NoRepo state, let's load dynamicconfigs
in that situation.

This also supports the case where there is no user name.

Reviewed By: kulshrax

Differential Revision: D26801059

fbshipit-source-id: 377cfffb6695a7fbe31303868a88862259ebf8c4
2021-04-14 14:32:16 -07:00
Meyer Jacobs
fb44958218 scmstore: improve debugscmstore command to support fetching arbitrary files / trees
Summary:
Extend debugscmstore command to fetch arbitrary files / trees by key.

Replace debugpyscmstore with a python fallback for debugscmstore (allowing you to test with the store as it is constructed for Python, with legacy fallback).

Refactor some functionality so it is shared between the rust and python versions of debugscmstore.

Currently the output is pretty ugly. It uses the `{:#?}` format for everything. In the next change, I propose modifying the `Debug` implementation for `minibytes::Bytes` to use ascii-escaped bytestrings rather than the default slice formatter to make things much nicer.

This new `debugscmstore` functionality should be useful in integration tests for testing scmstore under different repo configurations, and for test harnesses and performance testing (fetch a specific set of things easily, simulate delays in the key stream by delaying the input pipe, etc).

Reviewed By: andll

Differential Revision: D27351321

fbshipit-source-id: 8650480e3f5b045b279472643570309c48d7fe6b
2021-04-13 22:13:03 -07:00
Andrey Chursin
b6160bbb4a checkout: add test for checking out unknown files
Summary: This test fails without other diffs in stack because previously native checkout was overwriting untracked files

Reviewed By: DurhamG

Differential Revision: D27667151

fbshipit-source-id: 9b3aea37ba5c2d07fe4fc975dd40b4d7bea9d810
2021-04-13 20:43:40 -07:00
Meyer Jacobs
ca15d69cc0 tests: revert commitcloud-backup-sql tests to use legacy behavior.
Summary: These tests were broken in D27710099 (876f812e4b), but they show as passing unless run in a particular environment, so it went unnoticed. This change reverts the tests to use the pre- D27710099 (876f812e4b) behavior, which should unbreak them until they can be updated correctly.

Reviewed By: quark-zju

Differential Revision: D27756348

fbshipit-source-id: cfa6c12871b6ac0d22b8c70400e72b3ec5dd83a3
2021-04-13 19:14:38 -07:00
Jun Wu
d1dabad879 dag: update overlay_map on flush
Summary:
The `add_heads_and_flush` method might add new nodes in the master group,
and it should update `overlay_map_next_id` accordingly. Without it, it
might error out like:

  RustError: ProgrammingError: Server returned x~n (x = 9ebc9ebc49f1819767b40f9ceb22c37547a10c37 8459584, n = 1411).
  But x exceeds the head in the local master group {}. This is not expected and indicates some logic error on the server side.

Full error: P387088806

Reviewed By: sfilipco

Differential Revision: D27637278

fbshipit-source-id: b45370db0561dec52cd513a12e2fd0110f18e0e5
2021-04-13 17:12:47 -07:00
Jun Wu
48e732f58d changelog: avoid testing nodemap.__contains__ in a loop
Summary:
That could cause a slow loop testing node.__contains__ remotely.

This changes the behavior subtly - nodes added via addgroup will change `tip`
position regardless of whether the nodes exist. This might be more desirable,
since add or addgroup explicitly adding nodes should probably update the
tip position.

Offending test `test-globalrevs-requires.t` was removed since we have
forked the server-side codebase and do not need to maintain hg server
features here.

Reviewed By: sfilipco

Differential Revision: D27630090

fbshipit-source-id: cf7ecc44bf08ed756f0f1aece6655bf674171249
2021-04-13 17:12:47 -07:00
Jun Wu
72507580de smartset: use nameset instead of idset for spans
Summary:
The idset is not fully backed by Rust and do not batch resolve vertexes.
The nameset is backed by Rust NameSet and has proper batch prefetching.
Use nameset if possible but fallback to idset if the backend is not in
Rust (rare, only used by hgsql repos now).

Reviewed By: sfilipco

Differential Revision: D27630092

fbshipit-source-id: cf847dd1a78bd5273a8928ecb6616fe11f2c7026
2021-04-13 16:56:17 -07:00
Jun Wu
e365eec476 revset: do not autopull x or y for revset limit(a, x, y)
Summary:
In revset limit(a, x, y), both x and y are numbers, not commit identities.
The issue is that the revset AST uses different ways to represent functions
with one argument or multiple arguments. For example:

  (func (symbol parents) (symbol master))
  (func (symbol limit)   (list (x) (symbol 1) (symbol 2)))

Fix it by special handling the `list` AST.

Reviewed By: DurhamG

Differential Revision: D27632395

fbshipit-source-id: 081506bdd4b10e197a2685f4ab4d6448fbd79957
2021-04-13 14:34:41 -07:00
Jun Wu
ca30d55bd0 hgcommands: add debugracyoutput
Summary:
Recently we saw some progress rendering issues. Add a command to attempt to
reproduce them.

Reviewed By: DurhamG

Differential Revision: D27669184

fbshipit-source-id: 62fcf82d8261fd27e91ba5a116c61f4df1919007
2021-04-13 13:47:17 -07:00
Mark Juggurnauth-Thomas
876f812e4b commitcloud: do not send backup bookmarks part
Summary:
The backupbookmarks part was used for infinitepush backup bookmarks, which were
deprecated.  Now stop sending the part entirely unless
`commitcloud.pushbackupbookmarks` is set.

Reviewed By: StanislavGlebik

Differential Revision: D27710099

fbshipit-source-id: 1eb404f106f5a8d9df6d73e11f60f89c1fa10400
2021-04-13 03:07:50 -07:00
Andrey Chursin
80adbe385c rename ephemeralcommit->hiddencommit
Summary: This name is more reasonable, since this commit is not actually ephemeral

Reviewed By: quark-zju

Differential Revision: D27722921

fbshipit-source-id: e2c0243d41a73341f9d0afdc79696ea37b34b8c7
2021-04-12 20:13:11 -07:00
Jun Wu
2480bfcef5 discovery: remove unused discovery logic
Summary:
We have `experimental.findcommonheadsnew` set to True in all tests, and
Rust commit backends force the `findcommonheadsnew` paths, which is
pretty much everywhere except hgsql repos. Remove `_findcommonheadsold`.

The fast discovery is also unnecessary. Remove them too.

Reviewed By: DurhamG

Differential Revision: D27630496

fbshipit-source-id: ab1948f03a8c84e75e3b5c9ff4769e17533447d2
2021-04-12 17:11:37 -07:00
Durham Goode
14831f732b tests: fix test-check-code
Summary:
D27659634 (8e8aaa61d6) removed these files, so let's drop their exclusions from
test-check-code.t

Reviewed By: sfilipco

Differential Revision: D27682136

fbshipit-source-id: f8e10fac37ea90fb2782b960faf4536f1ff9133b
2021-04-09 10:59:46 -07:00
Liubov Dmitrieva
e11142d243 introduce a way of requesting unhydrated commits
Summary: introduce a way of requesting unhydrated commits using client telemetry

Reviewed By: StanislavGlebik

Differential Revision: D27591868

fbshipit-source-id: 7616f9d3b222c2c7f43c2ba930086eb0ec9e15bc
2021-04-07 03:02:32 -07:00
Arun Kulshreshtha
e26bc3ffa4 clidispatch: add --insecure global flag
Summary: Add the `--insecure` flag to the list of global hg flags. This flag is already supported by Python, and adding it here will make it available to Rust code as well. This is used later in the stack.

Reviewed By: quark-zju

Differential Revision: D27243029

fbshipit-source-id: 150d42ee96e1e3194ff1be6a33d9b36887d86f2c
2021-03-31 12:53:46 -07:00
Liubov Dmitrieva
580c02a480 implementing hiding of scratch bookmarks with hg hide -B <name>
Summary: Alow hiding scratch bookmarks if selective pull is enabled

Reviewed By: quark-zju

Differential Revision: D27160251

fbshipit-source-id: 0ba839fc5c26189309c92e62293ee85acd8cb218
2021-03-31 10:05:16 -07:00
Andrey Chursin
addfb9f600 simple util for ephemeral commits
Summary:
Production confidence team wants a simple tool to capture current state of the repo and get a commit hash in commitcloud
ephemeralcommit achieves that by making a hidden commit and pushing it to commitcloud

Main purpose of this is to use with ephemeral fbpkg, this produces relatively low volume of commits (comparing to total commit count).

This currently does not add untracked files, but removes missing files

Usage:
```
# note that when invoking from automatic tools need to specify -q
$ hg debugephemeralcommit -q
<hash of the commit>
```

Reviewed By: quark-zju

Differential Revision: D27339320

fbshipit-source-id: 07a4ea8ff80b80ce620fb609096db97f46d383dc
2021-03-30 16:16:47 -07:00
Jun Wu
3293397be7 tests: disable ignorerevnum for 2 potentially incompatible tests
Summary: They seem to fail because of ignorerevnum.

Differential Revision: D27445917

fbshipit-source-id: dae7884aeebbc4cd45c9b694ed035f0f26f2f094
2021-03-30 15:20:42 -07:00
Carolyn Busch
86996ffa9f tests: Remove errno.WSAEACCES
Summary: WSAEACCES is included in Windows only. Only check it if the os is windows.

Reviewed By: quark-zju

Differential Revision: D27434606

fbshipit-source-id: 25eb8036363b42629fbd010f7637a404dccff236
2021-03-30 11:20:56 -07:00
Jun Wu
8b76f8a7de tests: fix compatibility with ignorerevnum
Summary: Integration test and macOS tests did not run at diff time.

Reviewed By: DurhamG

Differential Revision: D27436108

fbshipit-source-id: ab94ec88bad8de42025f539023ab426002b9bed5
2021-03-30 10:43:04 -07:00
Carolyn Busch
c481f9e27d Disable test-lfs-placeholders.t for windows
Summary: test-lfs-placeholders.t fails on windows. The code isn't used on Windows so mark the test as no-windows.

Reviewed By: sfilipco

Differential Revision: D27433793

fbshipit-source-id: 4cbf70efae655ca318d776f6a2d6b79e83c78cbc
2021-03-30 09:21:33 -07:00
Jun Wu
48cd15ab14 context: add a way to disable revnum resolution
Summary:
Add a way to disable revnum resolution for non-automation (non-HGPLAIN)
usecases. Automation (ex. nuclide-core) still use revision numbers.

Some tests still use revnums. Put them in a list so this feature
does not break them.

Reviewed By: DurhamG

Differential Revision: D27144492

fbshipit-source-id: fba97fc90c7942e53914c29354938178b2637f44
2021-03-29 22:18:42 -07:00
Jun Wu
1ce6df8e42 remotefilelog: use changelog parent instead of manifest parent
Summary:
Manifest parent triggers an unimplemented tree history fetch path and is
generally prone to errors. See D9013996 (2b7e9e5e8b) and D9013995 (9e51fdef40).

Reviewed By: DurhamG

Differential Revision: D27411626

fbshipit-source-id: aee79f7928f0eb7fd39f68d12ec3ca33873f4e0b
2021-03-29 21:21:37 -07:00
Durham Goode
945a516c74 py3: fix tests on Windows
Summary: This fixes various tests on Windows. Many of these fixes were ported from upstream.

Reviewed By: markbt

Differential Revision: D27174617

fbshipit-source-id: b9f36ad0714793f2b76db32c1d840284b744a841
2021-03-29 12:56:48 -07:00
Mateusz Kwapich
37be91c51b add an experimental placeholder mode to lfs
Summary:
The placeholder mode is meant to be used when talking to LFS server is not available in
given environment. It allows the user to work in degraded mode where
all of the LFS files are replaced with placeholders informing about their
original sizes and hashes.

Reviewed By: xavierd

Differential Revision: D27294603

fbshipit-source-id: 2bb8e2cb74ffccefcd90d618d6791ce5c45755d6
2021-03-29 10:23:02 -07:00
Mark Juggurnauth-Thomas
810192fad4 commitcloud: ensure remotebookmarks in local state matches the cloud
Summary:
The `remotebookmarks` field in the local commit cloud state should always be one of:
* The empty set, if the previous sync was performed with remotebookmarks sync disabled; or
* The cloud workspace's remote bookmarks for that version.

Currently when processing remote bookmarks, we may store in the local state the
outcome of conflict resolution for the remote bookmarks.  This is the wrong
thing to do, as it means we won't then upload those conflict resolutions as a
new cloud version, which means they may get lost and rolled back.

Change application of cloud remote bookmarks to store the cloud remote bookmarks
in the local state, even if we changed them through conflict resolution.  This
means we will always upload the newly updated remote bookmarks to the server,
and things will stay more in sync.

Reviewed By: quark-zju

Differential Revision: D27291238

fbshipit-source-id: 8e6a0ab150da5907d32b8127aa0e6ccb17df4eea
2021-03-26 02:15:09 -07:00
Mark Juggurnauth-Thomas
7e5548cda2 commitcloud: add test showing remotebookmark bug on initial sync
Summary:
When connecting to a commit cloud workspace where there are no draft commits to
pull, no local bookmarks to sync, but the remote bookmarks in the local repo
are ahead of the ones in the commit cloud workspace, we fail to sync the remote
bookmarks to the server.

This results in the remote bookmark rewinding on the next sync.

Reviewed By: quark-zju

Differential Revision: D27291237

fbshipit-source-id: 8ba56542492fda26b9cecb6726ddd1b85ed5c180
2021-03-26 02:15:09 -07:00
Meyer Jacobs
943e3beaa1 scmstore: rename newstore to scmstore
Summary:
Rename "newstore" to "scmstore"

The three main options I'm considering are "edenstore", "scmstore", and "hgstore". They all describe the project sufficiently well, in my opinion. "edenstore" might be a stretch, as I have no reals plans for Mononoke to use it, while "hgstore" might be a bit limited, as integration with EdenFS is a core goal, and it'll be used by EdenFS to fetch remote data via EdenApi, not just Mercurial's local storage. I feel like "scmstore" rolls off the tongue the easiest, particularly vs. "hgstore" (both "H.G. Store" and "Mercurial Store"), and is a bit easier to type than "edenstore" (which has "ede" all with the same finger). I don't have a strong opinion on this matter, so If you'd like a different name I'm open to suggestions.

Speak now or forever hold your peace.

Reviewed By: andll

Differential Revision: D27180332

fbshipit-source-id: 19e6972ea0f6527e671792845dcfd339cf1ab767
2021-03-24 12:53:01 -07:00
Jun Wu
ab74c10962 test-run-tests: remove xml test cases for test reliability
Summary:
There was a recent build failure that looks like:

    --- test-run-tests.t
    +++ test-run-tests.t.err
    @@ -375,21 +375,19 @@
       [1]
       $ cat xunit.xml
       <?xml version="1.0" encoding="utf-8"?>
    -  <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3">
    +  <testsuite name="run-tests" tests="3" errors="0" failures="2" skipped="0">
         <testcase name="test-success.t" time="*"/> (glob)
         <testcase name="test-failure-unicode.t" time="*"> (glob)
    -      <failure message="output changed" type="output-mismatch">
    -  <![CDATA[--- test-failure-unicode.t
    +      <failure message="output changed" type="output-mismatch"><![CDATA[--- test-failure-unicode.t
       +++ test-failure-unicode.t.err
       @@ -1,2 +1,2 @@
          $ echo babar\xce\xb1 (esc)
       -  l\xce\xb5\xce\xb5t (esc)
       +  babar\xce\xb1 (esc)
    -  ]]>    </failure>
    +  ]]></failure>
         </testcase>
         <testcase name="test-failure.t" time="*"> (glob)
    -      <failure message="output changed" type="output-mismatch">
    -  <![CDATA[--- test-failure.t
    +      <failure message="output changed" type="output-mismatch"><![CDATA[--- test-failure.t
       +++ test-failure.t.err
       @@ -1,5 +1,5 @@
          $ echo babar
    @@ -398,7 +396,7 @@
        This is a noop statement so that
        this test is still more bytes than success.
        pad pad pad pad............................................................
    -  ]]>    </failure>
    +  ]]></failure>
         </testcase>
       </testsuite>

    @@ -435,7 +433,7 @@
       test-success.t
       $ cat xunit.xml
       <?xml version="1.0" encoding="utf-8"?>
    -  <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0">
    +  <testsuite name="run-tests" tests="0" errors="0" failures="0" skipped="0">
         <testcase name="test-failure-unicode.t"/>
         <testcase name="test-failure.t"/>
         <testcase name="test-success.t"/>
    @@ -455,7 +453,7 @@
       } (no-eol)
       $ cat xunit.xml
       <?xml version="1.0" encoding="utf-8"?>
    -  <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0">
    +  <testsuite name="run-tests" tests="0" errors="0" failures="0" skipped="0">
         <testcase name="test-failure-unicode.t"/>
         <testcase name="test-failure.t"/>
       </testsuite>
    @@ -1086,11 +1084,10 @@
       # Ran 2 tests, 2 skipped, 0 failed.
       $ cat xunit.xml
       <?xml version="1.0" encoding="utf-8"?>
    -  <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
    +  <testsuite name="run-tests" tests="2" errors="0" failures="0" skipped="2">
         <testcase name="test-success.t" time="*"/> (glob)
         <testcase name="test-skip.t">
    -      <skipped>
    -  <![CDATA[missing feature: nail clipper]]>    </skipped>
    +      <skipped><![CDATA[missing feature: nail clipper]]></skipped>
         </testcase>
       </testsuite>

Seems to be something changed in XML representation. We don't use the XML interface
in production so let's just skip testing it.

Reviewed By: kulshrax

Differential Revision: D27273482

fbshipit-source-id: 954a60209adeb3362f10705302dc742358299378
2021-03-23 23:04:24 -07:00
Jun Wu
bec9562260 test-doctor: improve reliability
Summary:
Similar to D27064825 (7eea44ce4e). There are 2 `hg status` calls and D27064825 (7eea44ce4e) only fixed one of them.

Sample failure:

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

Reviewed By: kulshrax

Differential Revision: D27249712

fbshipit-source-id: 0e628959c88218d6340f2597953850d654b12a8c
2021-03-23 12:25:01 -07:00
Jan Mazur
1ca5f6bfae quiet git init command not to print out hint
Summary:
Git client was updated and it started outputting a hint that breaks our tests. It has no meaning in tests so just quiet it.

```
➜  fbcode git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /data/users/mzr/fbsource/fbcode/.git/
```

Reviewed By: StanislavGlebik

Differential Revision: D27232853

fbshipit-source-id: 683ebebb36049adb758e7c26f843f12159a45301
2021-03-23 02:28:52 -07:00
Meyer Jacobs
c4dd06e57d newstore: python bindings for constructing newstore objects
Summary:
Introduce newfilestore class in pyrevisionstore, which constructs a newfilestore (BoxedReadStore for files) and a corresponding `ContentStore` which share the underlying IndexedLog object and EdenApi client.

Modify remotefilelog to construct ContentStore via this new class.

Currently, no methods are provided for the newfilestore - it is meant to be passed back into Rust code, where you may call it's Rust methods as shown in the `test_newstore` method (which will be removed in the future).

Currently the `util` module is made public for access from pyrevisionstore. In the future, this will be replaced in favor of a `NewFileStoreBuilder` which handles these concerns internally.

Reviewed By: DurhamG

Differential Revision: D26526331

fbshipit-source-id: c0f439fbee4c303db4a82171c866a3f3a5fc2324
2021-03-22 19:36:48 -07:00
Jun Wu
e7ffe860c3 test-convert-git: fix test with latest git
Summary:
The latest git prints extra hints:

       $ git init repo
    +  hint: Using 'master' as the name for the initial branch. This default branch name
    +  hint: is subject to change. To configure the initial branch name to use in all
    +  hint: of your new repositories, which will suppress this warning, call:
    +  hint:
    +  hint: 	git config --global init.defaultBranch <name>
    +  hint:
    +  hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
    +  hint: 'development'. The just-created branch can be renamed via this command:
    +  hint:
    +  hint: 	git branch -m <name>
       Initialized empty Git repository in $TESTTMP/repo/.git/

Silent it to make the test pass.

Reviewed By: akushner

Differential Revision: D27235547

fbshipit-source-id: 6f7c8da3ac1e01ee9f57730e1586fa2053f9ca98
2021-03-22 10:49:09 -07:00
Liubov Dmitrieva
77a1beb917 improve output of hg cloud status command for a renamed current workspace
Summary:
a workspace could be renamed from a different machine

educate users that they need to switch to a valid workspace

Reviewed By: markbt

Differential Revision: D27155544

fbshipit-source-id: eed066f2f3e6ebf99732499fdb355f8aebb4c1df
2021-03-22 07:03:17 -07:00
Liubov Dmitrieva
029a5b5d5a improve output of hg cloud list command for a renamed current workspace
Summary:
this could happen if it has been removed from a different machine

In this case, we should educate the users about the '--force' option

Reviewed By: markbt

Differential Revision: D27155423

fbshipit-source-id: 41cc3ac769dfd4145031fef687e8069d0ef8f4c9
2021-03-22 07:03:17 -07:00
Durham Goode
b8ca876ee0 configs: add --configfile's to new .hg/hgrc during clone
Summary:
We've been seeing issues where repositories end up with incorrect
dynamic configuration since there's a window of time after they're cloned where
they don't have %include /etc/mercurial/.../repo.rc and therefore generate an
incorrect dynamicconfig which gets used for 15 minutes until we regen the
dynamicconfig.

Let's change hg clone to write the %include as part of the initial hgrc, so we
remove that window of time and the repo will always be correctly configured.

Reviewed By: quark-zju

Differential Revision: D27093772

fbshipit-source-id: a9ca0ec54e06549546d532d1c49a80d49981decf
2021-03-18 10:23:07 -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
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
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
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
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
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
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
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
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
Durham Goode
541aa5daa8 tests: fix test-config.t on Windows
Summary: A recent diff modified this test and accidentally introduced a mismatch with Windows. Let's glob out the different path separators.

Reviewed By: quark-zju

Differential Revision: D26997063

fbshipit-source-id: 3cbe1f1fa748f8282fe16ee3d38f23519c87f6b9
2021-03-11 16:03:11 -08:00