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
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
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
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
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
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
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
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
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