Commit Graph

14 Commits

Author SHA1 Message Date
Stefan Filip
7904ebcfe0 dirstate: fix special handling of root directory
Summary:
D16716743 breaks the Windows build. One of the breakages is that `hg status`
stops working and crashes with `RuntimeError: invalid encoding`. This is
because dirstate has special treatment for root directories. Changing the
representation of the root directory stopped the special treatment.

Reviewed By: quark-zju

Differential Revision: D16812743

fbshipit-source-id: 49f96c87f471876993aec332e032ffcd619d268b
2019-08-14 15:47:25 -07:00
Stefan Filip
e985cb2472 match: use "" instead of "." for root directory (API)
Summary:
Change originally made by martinvonz in the mercurial repository:
Backporting https://phab.mercurial-scm.org/D6401

> I think '' is generally a better value for the root directory than '.'
is. For example, os.path.join('', 'foo') => 'foo', while
os.path.join('.', 'foo') => './foo'.
This patch mostly makes it so we use '' internally in
match.py. However, it also affects the API in visitdir(),
visitchildrenset() and files(). The two former now also accept '' as
input. I've updated the callers of these methods. I've also added a
deprecation warning for passing '.' (for external callers). The only
caller I could find that was affected by files() returning '' instead
of '.' was in dirstate.walk(). I've updated that.
The next few patches show some workarounds we can remove by using ''
instead of '.'.

Reviewed By: quark-zju

Differential Revision: D16716743

fbshipit-source-id: 4cc18b8cdf2f8a9dc44c42729fb46796a16c3244
2019-08-12 14:34:36 -07:00
Stefan Filip
76bca05339 dirstate: move special handling of files==['.'] together
Summary:
Change originally made by martinvonz in the mercurial repository:
https://phab.mercurial-scm.org/D6400

> I think it makes it a little clearer to have the two conditions for
files==['.'] near each other.

Reviewed By: quark-zju

Differential Revision: D16716745

fbshipit-source-id: c0d4eaf7d0fd7064845984b40d8e558264318d70
2019-08-12 14:34:36 -07:00
Jun Wu
850bb2d161 dirstate: remove hgignore features
Summary: We have turned off hgignroe globally for a while. Let's remove the code now.

Reviewed By: kulshrax

Differential Revision: D15110678

fbshipit-source-id: d0c2061413f6a48a6bfda5b26d15007e7890d20c
2019-04-29 18:22:37 -07:00
Mark Thomas
94257a258b blackbox: clean up blackbox logging and log more during rage
Summary:
Clean up some of the calls to `ui.log` and how they appear in blackbox logging.

* Make the names of the events consistently use `snake_case`.
* For watchman, only log once for each watchman command.  Include whether or not it failed.
* Unify `fsmonitor` logging under the `fsmonitor` event.
* Omit the second argument when it is empty - it is optional and does nothing when empty.
* Increase the number of blackbox lines included in rage to 100.

Reviewed By: quark-zju

Differential Revision: D14949868

fbshipit-source-id: a9aa8251e71ae7ca556c08116f8f7c61ff472218
2019-04-23 02:48:50 -07:00
Mark Thomas
fc9106e076 dirstate: add checkoutidentifier to identify and correlate checkouts
Summary:
When the user checks out a new commit (either by updating to it, by
creating a new commit, or by amending or rebasing the current commit), create a
unique identifier for that checkout.

Log this identifier at the start and end of command processing, and allow other
tools to also query and log the identifier.

This allows both Mercurial commands and other commands that log the identifier
to be correlated with a particular checkout.

Reviewed By: quark-zju

Differential Revision: D14648523

fbshipit-source-id: 2fad79c3010f5fad1a0e180e3d3d6d9c0a7f8e85
2019-04-04 11:29:49 -07:00
Mark Thomas
9cf99b9293 sampling: log working directory parents before and after commands
Reviewed By: quark-zju

Differential Revision: D14648522

fbshipit-source-id: 7c67ae3fa0542dd38fd87c5e2a2b421f73e4e12d
2019-04-04 11:29:49 -07:00
Durham Goode
73683c048e tracing: add various tracing across the code base
Summary:
Now that we have perftracing infra, let's trace a bunch of likely
problem spots.

Reviewed By: sfilipco

Differential Revision: D14426367

fbshipit-source-id: 354a241aa9ac5d75d34062a9838d581b4f46746f
2019-03-25 19:31:13 -07:00
Jun Wu
45e726f245 ignore: revise debugignore
Summary:
Change debugignore to test directories properly (which, only affects sparse
repos in practise) and stop printing out the source ignore rule location, as we
no longer have that information in the gitignore world.

Reviewed By: markbt

Differential Revision: D14547049

fbshipit-source-id: e7c307b1e1f4a8dcd30d00bec1f3e7a84a14b47b
2019-03-22 08:18:24 -07:00
Jun Wu
9e0a7c41a4 subrepo: remove subrepo support
Summary:
Subrepo is another unloved features that we don't want to support.

Aggressively remove it everywhere, instead of just turning off configs.

I didn't spend much time to split this commit so it's smaller and more friendly
to review. But it seems tests are passing.

Reviewed By: sfilipco

Differential Revision: D14220099

fbshipit-source-id: adc512a047d99cd4bafd0362e3e9b24e71defe13
2019-03-11 10:43:55 -07:00
Jun Wu
338fe1197f dirstate: add more logging to debug T39234759
Summary:
"st_size" returned by watchman is sometimes 0. We suspect it's incorrect.
It could be the file on disk is actually empty, or the kernel made it
look empty to watchman in the past, or there is something wrong with
serialization, etc. Let's first add a real os.stat to test if the file
is really empty.

Reviewed By: phillco

Differential Revision: D14090851

fbshipit-source-id: bd75cf86bfd117285658ad0dd7fb28d0e8b5585c
2019-02-14 16:29:46 -08:00
Aida Getoeva
baa9bab088 set ui.slash=True if HGPLAIN=1
Summary:
`hg status` should show slashes in filepaths standard for the diff format. Now it shows windows' backslash.

More details:
https://fb.workplace.com/groups/scm/permalink/1933867456662865/

Reviewed By: quark-zju

Differential Revision: D13944478

fbshipit-source-id: d34d2c6bc0b9966e1806e36668c21e8abfc83a02
2019-02-07 04:32:27 -08:00
Jun Wu
f8f8e3962a status: add a way to log more details about why hg thinks a file was modified
Summary:
We're seeing issues where a file show up as "M" while it isn't expected so. When
running "hg status" again, the file disappeared. Existing logs suggest that
watchman does not think anything has changed between the two "status" commands.
Therefore add more logs of the internals to try to get more insights.

Differential Revision: D13954209

fbshipit-source-id: 0b89a6da5e8702e707440ef2e1823eb4968c10be
2019-02-05 19:41:35 -08:00
Jun Wu
c12e300bb8 codemod: move Python packages to edenscm
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.

To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.

Reviewed By: phillco, ikostia

Differential Revision: D13853115

fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e
2019-01-28 18:35:41 -08:00