316 Commits
Author SHA1 Message Date
Erich Gubler 0734d2d658 Bug 2029829 - fix(jj): correct broken clean_directory impl. r=sfink
I doubt that this ever worked. At the time this code was written, `jj` 0.28.2 was the latest release. The [0.28.2 docs for `jj restore`] do not include a `-r` argument.

Comparing to the `git.py` sibling file, it seems the intent may have been to use `-f/--from`, i.e., "please discard anything in the current change at `$path`". Restoring the current change's contents to the parent change is the default behavior with no options, so all we need to do is provide the path to be cleared as a positional argument to narrow as desired.

Add an end-of-options sentinel (`--`) for good measure, to guard against file names with a leading `-`.

[0.28.2 docs for `jj restore`]: https://docs.jj-vcs.dev/v0.28.2/cli-reference/#jj-restore

Differential Revision: https://phabricator.services.mozilla.com/D292267
2026-06-04 15:29:50 +00:00
Erich Gubler cd0db4cbae Bug 2029030 - refactor(hg): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D292527
2026-06-04 15:29:48 +00:00
Erich Gubler 055b54ed27 Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291897
2026-06-04 15:29:45 +00:00
Erich Gubler 174ea61b9e Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291896
2026-06-04 15:29:43 +00:00
Erich Gubler 3e7869d813 Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291895
2026-06-04 15:29:41 +00:00
Erich Gubler 03e9a48ff5 Bug 2029030 - refactor(jj): s/-r/--revision[s] for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291894
2026-06-04 15:29:38 +00:00
Erich Gubler a80b77cc7a Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291893
2026-06-04 15:29:36 +00:00
Atila Butkovits 0f3d277685 Revert "Bug 2029829 - fix(jj): correct broken clean_directory impl. r=sfink" for causing failures at test_push_to_try.py.
This reverts commit 355055f73c.

Revert "Bug 2029030 - refactor(hg): s/-m/--message for clarity r=sfink"

This reverts commit ee6da071d2.

Revert "Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink"

This reverts commit bd57f50d99.

Revert "Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink"

This reverts commit b64c2400e0.

Revert "Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink"

This reverts commit d4722092f6.

Revert "Bug 2029030 - refactor(jj): s/-r/--revision[s] for clarity r=sfink"

This reverts commit 7fb02f02ef.

Revert "Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink"

This reverts commit c9c6498fdf.
2026-06-04 13:57:49 +00:00
Erich Gubler 355055f73c Bug 2029829 - fix(jj): correct broken clean_directory impl. r=sfink
I doubt that this ever worked. At the time this code was written, `jj` 0.28.2 was the latest release. The [0.28.2 docs for `jj restore`] do not include a `-r` argument.

Comparing to the `git.py` sibling file, it seems the intent may have been to use `-f/--from`, i.e., "please discard anything in the current change at `$path`". Restoring the current change's contents to the parent change is the default behavior with no options, so all we need to do is provide the path to be cleared as a positional argument to narrow as desired.

Add an end-of-options sentinel (`--`) for good measure, to guard against file names with a leading `-`.

[0.28.2 docs for `jj restore`]: https://docs.jj-vcs.dev/v0.28.2/cli-reference/#jj-restore

Differential Revision: https://phabricator.services.mozilla.com/D292267
2026-06-04 13:38:25 +00:00
Erich Gubler ee6da071d2 Bug 2029030 - refactor(hg): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D292527
2026-06-04 13:38:23 +00:00
Erich Gubler bd57f50d99 Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291897
2026-06-04 13:38:20 +00:00
Erich Gubler b64c2400e0 Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291896
2026-06-04 13:38:18 +00:00
Erich Gubler d4722092f6 Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291895
2026-06-04 13:38:16 +00:00
Erich Gubler 7fb02f02ef Bug 2029030 - refactor(jj): s/-r/--revision[s] for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291894
2026-06-04 13:38:14 +00:00
Erich Gubler c9c6498fdf Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291893
2026-06-04 13:38:12 +00:00
Andrew Halberstadt 82d8fe66d6 Bug 2042926 - [mozversioncontrol] Adjust branch prefix used when pushing to Git try, r=ahochheiden
We decided to namespace user branches under `user/<username>/`

Differential Revision: https://phabricator.services.mozilla.com/D303074
2026-05-28 23:44:05 +00:00
Andrew Halberstadt 8511f5cebe Bug 2042926 - [mozversioncontrol] Refactor try push logic into base class, r=ahochheiden
The logic to push to try is almost entirely shared between jj and git,
so move it to the base class.

Differential Revision: https://phabricator.services.mozilla.com/D303073
2026-05-28 23:44:02 +00:00
Andrew Halberstadt 7e845fb55f Bug 2042926 - [mozversioncontrol] Namespace try branches under a <username>/ prefix, r=ahochheiden
With dozens to potentially hundreds of developers all pushing to the
same repo, namespacing branches will help avoid conflicts and gives us a
point of contact if we ever need to find a branch's owner.

Differential Revision: https://phabricator.services.mozilla.com/D302867
2026-05-28 03:23:32 +00:00
Andrew Halberstadt 4c4932b749 Bug 2041426 - [tryselect] Create bookmark if necessary when pushing with jj, r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D302086
2026-05-27 21:58:05 +00:00
Andrew Halberstadt 727a3c7fbe Bug 2041426 - [mozversioncontrol] Consolidate try push logic into 'push_to_try' method, r=ahochheiden
This allows consumers like `mach try` to call into a single entrypoint
regardless of which vcs type is being pushed to.

Differential Revision: https://phabricator.services.mozilla.com/D302380
2026-05-27 21:58:02 +00:00
Andrew Halberstadt 7fdd4e65da Bug 2041426 - [mozversioncontrol] Use bookmark on head_ref as value for JujutsuRepository.branch, r=ahochheiden
This is essentially what we're looking for when trying to figure out
where to push.

Differential Revision: https://phabricator.services.mozilla.com/D302085
2026-05-26 19:34:47 +00:00
Andrew Halberstadt d318d6be1e Bug 2041426 - [mozversioncontrol] Resolve jj refs to commit ids when dest_branch exists, r=ahochheiden
This way if ref happens to be a change id, it'll be converted to
something Git understands. If it's a bookmark, it's fine to convert it
to a commit sha regardless as the dest_branch was explicitly provided.

Differential Revision: https://phabricator.services.mozilla.com/D302084
2026-05-26 19:34:44 +00:00
Andrew Halberstadt 89cdd810e8 Bug 2041426 - [mozversioncontrol] Use closest remote bookmark when printing list of changes pushed to try with Jujutsu, r=ahochheiden
If you pushed a branch not based on `trunk()`, this would result in many
unrelated commits (possibly hundreds) to your terminal. The new revset
finds the closest remote bookmark and compares off of that.

Differential Revision: https://phabricator.services.mozilla.com/D301888
2026-05-26 19:34:40 +00:00
Andrew Halberstadt 4fab5b98ea Bug 2041432 - Skip mozversioncontrol hg tests when hg is unavailable, r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D301887
2026-05-21 21:33:39 +00:00
Simon Chopin 343d128434 Bug 2031712 - use --[no-]base to generate patches from git r=firefox-build-system-reviewers,sheehan,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D294227
2026-04-23 23:47:21 +00:00
Andrew Halberstadt 7543e1eb70 Bug 2028208 - [mozversioncontrol] Defer to git implementation for jj push, r=ahochheiden
I really wanted to implement this using native jj commands, but I came
to the conclusion we should just defer to Git for two reasons:

1. Jujutsu decouples safety checks from the actual push operation,
   making it a real pain to use this push function. E.g, you need to
   make sure a bookmark exists, is tracked on the remote. Moving it
   requires `--allow-backwards`. All this needs to happen before push
   time, which doesn't work well with the mozversioncontrol model here.
   It puts all that complexity on the shoulders of the user.

2. For `./mach try` we need to be able to push arbitrary Git refs,
   namely `refs/notes/decision-parameters`. This simply isn't supported by Jujutsu yet,
   which means we'd need to defer to the underlying Git implementation
   anyway.

Initially that's what I did, but after a few frustrating days, I
realized that if I just always deferred to Git, all the annoying pain
points of trying to use my `mach try` prototype with Jujutsu simply went
away.

Differential Revision: https://phabricator.services.mozilla.com/D295618
2026-04-21 19:40:36 +00:00
Andrew Halberstadt 094715c19b Bug 2028208 - [mozversioncontrol] Ensure Git push output is streamed, r=ahochheiden
Sometimes large pushes can take *a long* time. Make sure output is
streamed to terminal rather than buffered until the end, otherwise it's
easy to think something is hanging.

Differential Revision: https://phabricator.services.mozilla.com/D295617
2026-04-21 19:40:33 +00:00
Andrew Halberstadt 9e3ca3e3aa Bug 2028208 - [mozversioncontrol] Implement add_note for git and jj, r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D294178
2026-04-21 19:40:29 +00:00
Andrew Halberstadt 719ae3ef46 Bug 2028208 - [mozversioncontrol] Rename 'head_ref' -> 'head_rev', r=ahochheiden
Currently `vcs.head_ref` is actually the revision for hg and git, but
the change id for jj. This inconsistency makes it tricky to find the
right thing across all three.

In reality, this property is simply wrong for Git and Hg. A ref is not a
revision.

To clear things up, this renames `head_ref` -> `head_rev` (implementing
it for jj). Then adds new implementations for `head_ref` that actually
return a ref. This is basically the same as `vcs.branch` but with a
fallback if no branch or bookmark is active.

Differential Revision: https://phabricator.services.mozilla.com/D294177
2026-04-21 19:40:26 +00:00
Silaghi d6a1a5d3fa Revert "Bug 2029030 - refactor(jj): s/-b/--bookmark for clarity r=sfink" for causing vcs failures at python/mozversioncontrol
This reverts commit dd2036e988.

Revert "Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink"

This reverts commit 75acc19ac5.

Revert "Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink"

This reverts commit 439d715e14.

Revert "Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink"

This reverts commit 3e7b5c64fc.

Revert "Bug 2029030 - refactor(jj): s/-r/--revision for clarity r=sfink"

This reverts commit 639a2ed9fe.

Revert "Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink"

This reverts commit 972c08d340.
2026-04-06 23:26:24 +00:00
Erich Gubler dd2036e988 Bug 2029030 - refactor(jj): s/-b/--bookmark for clarity r=sfink
Our `MINIMUM_SUPPORTED_JJ_VERSION` is [0.28.0], which means the only valid
"lengthening" of `-b` is `--bookmark`. Prior to this version, there may
have been a backwards compatibility argument for `-b`, but this doesn't
apply.

[0.28.0]: https://github.com/jj-vcs/jj/releases/tag/v0.28.0

Differential Revision: https://phabricator.services.mozilla.com/D291898
2026-04-06 23:09:35 +00:00
Erich Gubler 75acc19ac5 Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291897
2026-04-06 23:09:32 +00:00
Erich Gubler 439d715e14 Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291896
2026-04-06 23:09:28 +00:00
Erich Gubler 3e7b5c64fc Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291895
2026-04-06 23:09:25 +00:00
Erich Gubler 639a2ed9fe Bug 2029030 - refactor(jj): s/-r/--revision for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291894
2026-04-06 23:09:21 +00:00
Erich Gubler 972c08d340 Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291893
2026-04-06 23:09:18 +00:00
Silaghi 52e27e5c6f Revert "Bug 2029030 - refactor(jj): s/-b/--bookmark for clarity r=sfink" for casuing vcs failures at python/mozversioncontrol
This reverts commit 184b695bf5.

Revert "Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink"

This reverts commit e2c0f953aa.

Revert "Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink"

This reverts commit 3e422e23aa.

Revert "Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink"

This reverts commit f8e55d4f94.

Revert "Bug 2029030 - refactor(jj): s/-r/--revision for clarity r=sfink"

This reverts commit 59a6bf0ea9.

Revert "Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink"

This reverts commit d09b99bfcc.
2026-04-06 21:59:47 +00:00
Erich Gubler 184b695bf5 Bug 2029030 - refactor(jj): s/-b/--bookmark for clarity r=sfink
Our `MINIMUM_SUPPORTED_JJ_VERSION` is [0.28.0], which means the only valid
"lengthening" of `-b` is `--bookmark`. Prior to this version, there may
have been a backwards compatibility argument for `-b`, but this doesn't
apply.

[0.28.0]: https://github.com/jj-vcs/jj/releases/tag/v0.28.0

Differential Revision: https://phabricator.services.mozilla.com/D291898
2026-04-06 21:37:51 +00:00
Erich Gubler e2c0f953aa Bug 2029030 - refactor(hg): s/-a/--all for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291897
2026-04-06 21:37:48 +00:00
Erich Gubler 3e422e23aa Bug 2029030 - refactor(jj): s/-n/--limit for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291896
2026-04-06 21:37:44 +00:00
Erich Gubler f8e55d4f94 Bug 2029030 - refactor(jj): s/-m/--message for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291895
2026-04-06 21:37:41 +00:00
Erich Gubler 59a6bf0ea9 Bug 2029030 - refactor(jj): s/-r/--revision for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291894
2026-04-06 21:37:38 +00:00
Erich Gubler d09b99bfcc Bug 2029030 - refactor(jj): s/-T/--template for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D291893
2026-04-06 21:37:34 +00:00
Steve Fink 128c3180fa Bug 2025807 - Use --no-graph in favor of -G r=ErichDonGubler
For backwards compatibility as well as understandability.

Differential Revision: https://phabricator.services.mozilla.com/D291891
2026-04-03 00:16:11 +00:00
Steve Fink a585dfb914 Bug 2025807 - For jj, output the (mutable) changes being pushed to try r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D291350
2026-04-01 21:45:36 +00:00
Steve Fink cce0123b98 Bug 2025807 - Suppress snapshotting output, r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D290529
2026-04-01 21:45:34 +00:00
Andrew Halberstadt 3b4e166848 Bug 2021009 - [tryselect] Ensure temporary commit is pushed as well, r=ahochheiden
In Git, we were creating a temporary commit, then pushing the current
branch. But the temporary commit was a detached head and so wasn't
included in the push.

This ensures the temporary commit is included by adding the ability for
`vcs.push` to push a source ref to a separate destination branch.

Differential Revision: https://phabricator.services.mozilla.com/D288981
2026-03-24 06:22:26 +00:00
Alex Hochheiden 6dbb197f6b Bug 2024792 - Use _run instead of _run_read_only in get_last_modified_time_for_file to avoid stale results r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D288800
2026-03-20 22:58:54 +00:00
Alex Hochheiden 16355c275a Bug 2023268 - Fix ruff warnings in jj.py r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D287709
2026-03-20 22:58:52 +00:00
Alex Hochheiden ccbc72d7d2 Bug 2023268 - Make default jj configuration auto-update stale working copies by default r=sfink,ahal
Differential Revision: https://phabricator.services.mozilla.com/D287708
2026-03-20 22:58:50 +00:00