Commit Graph

5 Commits

Author SHA1 Message Date
Jun Wu
b4f21d70c7 annotate: work with deleted files
Summary:
When a file was deleted, then re-added, the deletion shows up in pathhistory.
The current pathhistory based annotate algorithm does not handle that and such
deletion can crash the algoirthm.  Fix it by following the history past deletion.

Reviewed By: muirdm

Differential Revision: D41462750

fbshipit-source-id: ff1fc1ff2d4df765d02758d29cca9848ed1754da
2022-11-23 14:09:13 -08:00
Jun Wu
9ce6fab271 context: compare fctx by commit hash
Summary:
Previously fctx was only compared by (path, filenode). In Mercurial filenode
contains history. In Git filenode doesn't and can cause the annotate algorithm
to infinite loop. Let's compare commit hash (node) to avoid issues.

Copy tracing logic was updated to emulate the old behavior for `test-graft.t`
to pass. We want to switch to a non-linkrev copytracing later.

Resolves #171.

Reviewed By: akushner

Differential Revision: D41462751

fbshipit-source-id: 81c5dd16632e4d56feeab352d798c73b3c654375
2022-11-23 14:09:13 -08:00
Durham Goode
39ea4d0bd5 git: fix crash when encountering -1 identifier
Summary:
The git objects assume everything coming in is a hash. The context.py
code however occasionally produced -1 (i.e. the nullrev). This caused crashes in
some circumstances. This diff fixes it by removing nullrev from context.py

Reviewed By: quark-zju

Differential Revision: D40517513

fbshipit-source-id: bcabca05be9ba43ab1f095903ca86fa8c938927f
2022-10-20 09:06:10 -07:00
Saul Gutierrez
41b41de101 replace hardcoded hg and Mercurial with @prog@ and @Product@ outside of helptext.py
Summary:
Makes help text (e.g. the output of `hg help`) and strings that use the `_()` function use the identity of the current binary instead of using hardcoded strings for the name of the binary and the product.

For the sake of clarity, replacements for `helptext.py` are done in D40165740

Most of the rename was done using sed + some manual edits. The regex strings for the rename were:

- `"s/\(_(\".*\)\([^.]+\)hg\([^[:alpha:]\/]\)\(.*\")\)/\1\2@prog@\3\4/g"`
- `"s/\(_(\".*\) hg \(.*\")\)/\1 prog@ \2/g"`
- `"s/\(_(\".*\)\([^.]\)hg\([^\/[:alpha:]]\)\(.*\")\)/\1\2@prog@\3\4/g"`
- `"s/\(_(\".*\)\([^.]\)hg\([^\/[:alpha:]]\)\(.*\")\)/\1\2@prog@\3\4/g"`
- `"s/\(_(\".*\)\([^.]\)hg\([^\/[:alpha:]]\)\(.*\")\)/\1\2@prog@\3\4/g"`

Reviewed By: bolinfest

Differential Revision: D40162909

fbshipit-source-id: 34d92ef3e667caad278643690e69bd608fc9fdf9
2022-10-10 16:39:36 -07:00
Muir Manders
44343769f8 collapse edenscm.mercurial package into edenscm
Summary:
We want to rename away from "mercurial". Rather than rename the "mercurial" Python package, we opted to just collapse it into the parent "edenscm" package. This is also a step towards further organizing we want to do around the new project name.

To ease the transition wrt hotfixes, we now replace "edenscm.mercurial" with "mercurial" to fix imports within base64-python extensions.

Reviewed By: sggutier

Differential Revision: D38943169

fbshipit-source-id: 03fa18079c51e2f7fac05d65b127095da3ab7c99
2022-08-24 13:45:53 -07:00