Summary:
Ref T13546. Ref T9948.
- Make "--hold" show the same set of commands to manually push that the normal workflow would use.
- Make save/restore state work.
- Make bookmark creation prompt for confirmation.
- Improve / provide some additional warnings and help text.
Test Plan: Ran various increasingly complex "arc land" workflows, e.g. "arc land --hold --onto fauxmark1 --onto fauxmark2 --into default . --revision 118 --trace"
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21351
Summary: Ref T9948. Ref T13546. Clean up some minor behaviors to allow "arc land" to function in the simplest cases again. Also, do a capability test for "prune" rather than just falling back.
Test Plan: Ran "arc land <mark>" in Mercurial, got changes pushed.
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21350
Summary:
Ref T9948. Ref T13546. To identify remote branch heads -- not just modified heads -- use "branchmap" like "hg outgoing" does.
I wasn't able to find any other way to get what we want: for example, with a bundlerepo, "peer.heads()" and "peer.changelog.heads()" include local branches which are not present in the remote.
It generally seems difficult (perhaps impossible?) to distinguish between these cases by using "getremotechanges()":
- branch X exists at position Y in both the local and remote;
- branch X exists at positino Y in the local, but not the remote.
In any case, this seems to work properly and //should// do less work than "getremotechanges()" since we don't need to pull as much data over the wire.
Test Plan: Ran "hg arc-ls-markers" in various repositories, got what appeared to be a faithful representation of the remote branch and bookmark state.
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21349
Summary:
Ref T9948. Ref T13546. This change moves toward a functional "arc land" in Mercurial.
Because of how "bundlerepo.getremotechanges()" works, "hg arc-ls-markers" does not actually list markers in the remote that aren't different from local markers so it's hard to get anywhere with this.
Test Plan: Got somewhat-encouraging output from "arc land" and "hg arc-ls-markers", but too many things are still broken for this to really work yet.
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21348
Summary: Ref T13546. In the new "arc land": actually reach build warnings; and show buildable URIs.
Test Plan: Ran "arc land ..." with intentionally broken builds, got more useful build warnings.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21347
Summary: Ref T13546. The modern constant from the modern API method for this state is "published", and this more narrowly covers the desired behavior (notably, excluding "Abandoned" revisions).
Test Plan: Ran "arc land ... --revision X" where "X" is a published revision, got an appropriate prompt.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21345
Summary:
Ref T9948. Ref T13546. We must passthru "hg ls-remote" because it might prompt the user for credentials.
Since "ls-remote" is implemented as an exension and we can't rely on using stdout beacuse of passthru, the actual command we execute is:
```
$ hg --config extensions.arc-hg=<huge long path to extension> arc-ls-remote --output <huge long path to temporary file> -- remote
```
This is meaningless and distracting; show the intent of the command we're executing instead. Users can see the raw command in "--trace" if they're actually debugging behavior.
Test Plan: Ran "arc land" in a Mercurial repository, got a tidier command output.
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21344
Summary: Ref T13546. Ref T9948. It seems challenging to examine a remote in vanilla Mercurial. Provide an "hg arc-ls-remote" command which functions like "git ls-remote" so we can figure out if "--into X" is a bookmark, branch, both, neither, or a branch with multiple heads without mutating the working copy as a side effect.
Test Plan: Ran various "arc land --into ..." commands in a Mercurial working copy, saw apparently-sensible resolution of remote marker names.
Maniphest Tasks: T13546, T9948
Differential Revision: https://secure.phabricator.com/D21343
Summary: Ref T13546. Parse "hg paths" and validate that the remotes "arc land" plans to interact with actually exist.
Test Plan: Ran "arc land" with good and bad "--into-remote" and "--onto-remote" arguments, got sensible validation behavior.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21342
Summary:
Ref T13546. If the "onto" branch doesn't exist yet and has a "/" in it, we need to preface it with "refs/heads" explicitly.
Fix a "false/null" issue with argument validation.
Possibly, "arc land" should prompt you before creating branches in the remote.
Test Plan: Ran "arc land --onto does-not-exist/1.1" and created a branch.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21341
Summary:
Ref T13546. If you have "feature1", "feature2", etc., "arc land feature4" will now land the entire sequence.
Provide "arc land --pick feature4" to work more like the old "arc land" did. This cherry-picks the commits associated with "feature4", then cascades onto the ancestor of the range.
Test Plan: Ran "arc land --pick land14" to pick a change out of a stack.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21340
Summary:
Ref T13546. When we encounter a merge conflict, suggest "--incremental" if it's likely to help.
When merging multiple changes, rebase ranges before merging them. This reduces conflicts when landing sequences of changes.
Test Plan: Ran "arc land" to land multiple changes. Hit better merge conflict messaging, then survived merge conflicts entirely.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21339
Summary: Ref T13546. Moves away from the older workflows in favor of "arc branches", "arc bookmarks", and "arc work".
Test Plan: Grepped for affected symbols, didn't find any callers.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21337
Summary: Ref T13546. Fixes T2928. Adds a new "arc work" workflow which functions like the older "arc feature" workflow, but with modern infrastructure.
Test Plan: Used "arc work" to begin work on branches, bookmarks, and revisions in Git and Mercurial.
Maniphest Tasks: T13546, T2928
Differential Revision: https://secure.phabricator.com/D21336
Summary: Ref T13546. Update the Mercurial code which finds default targets and maps symbols to targets under "arc land" to use the new MarkerRef workflow.
Test Plan: Ran "arc land" with (and without) various arguments in Mercurial, saw them resolve in a seemingly sensible way.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21335
Summary:
Ref T13546. Various Arcanist workflows, and particularly the MercurialAPI, currently repeat quite a lot of code around parsing branches and bookmarks.
In modern Mercurial, we can generally use the "head()" and "bookmark()" revsets to do this fairly sensibly.
This change mostly adds //more// code (and introduces "arc bookmarks" and "arc branches" as replacements for "arc bookmark" and "arc branch") but followups should be able to mostly delete code.
Test Plan: Ran "arc branches" and "arc bookmarks" in Git and Mercurial.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21333
Summary:
Ref T13546. Practically, this allows "arc branch" to run "arc branches".
(This risks overcorrection to some degree, but command correction only occurs if stdout is a TTY so the risk seems limited.)
Test Plan: Ran "arc branch", got "arc branches" as a correction.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21338
Summary: Ref T13546. The minimum required Mercurial version should now always have these features; if not, they should move to more modern feature tests.
Test Plan: Grepped for affected symbols.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21334
Summary: Ref T13546. When users hit a situation where we would select "squash" but would previously select "merge", prevent them from continuing under ambiguous conditions.
Test Plan: Ran "arc land" in Git with "history.immutable" true, false, and not configured.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21332
Summary: Ref T13546. Permit users to answer "y*" to mean "y, and don't ask me again".
Test Plan: Answered "y*" to some prompts, re-ran workflows, got auto-responses.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21331
Summary:
Fixes T13380. Ref T13546. Use slightly nicer command formatting for passthru commands, to make it more obvious what's going on and which pieces of output are from "arc" vs various subcommands.
Also, execute repository API passthru commands from the working copy root. All other commands already did this, the older API just didn't support it.
Test Plan: Ran "arc land" in Git and Mercurial repositories, saw nicer output formatting.
Maniphest Tasks: T13546, T13380
Differential Revision: https://secure.phabricator.com/D21330
Summary: Ref T13546. Implement the equivalents of "git stash" in Mercurial.
Test Plan: Dirtied a working copy in Mercurial, ran "arc land", saw dirty changes survive the process.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21329
Summary: Ref T13546. Update some of the "arc land --hold" behavior to be more functional/consistent with the updated workflow.
Test Plan: Ran "arc land --hold" under various conditions, got sensible forward/restore instructions.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21328
Summary:
Fixes T5420. Some "arc help ..." is long and most similar commands send this kind of output through a pager.
Use a pager in at least some cases.
Test Plan: Ran "arc help land", got pager output. Ran "arc help land | cat", got raw output.
Maniphest Tasks: T5420
Differential Revision: https://secure.phabricator.com/D21327
Summary: Ref T13546. Provide more up-to-date help about the "land" workflow, including modern flags and behavior.
Test Plan: Read "arc help land".
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21326
Summary: Ref T13546. This is mostly minor cleanup that improves behavior under "--revision".
Test Plan: Ran `arc land --into-empty` and `arc land --into-empty --revision 123` with ambiguous revisions in history to hit both the force and non-force outcomes.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21325
Summary:
Fixes T12876. Ref T13546. When you make the first change in a new Git repository, "arc land" currently can not merge it because there's nothing to merge into.
Support merging into the empty state formally, reachable by using "--into-empty" (which should be uncommon) or "arc land" in an empty repository.
Test Plan:
- Used "arc land --into-empty --hold ..." to generate merges against the empty state under "squash" and "merge" strategies in Git.
- Got sensible result commits with appropriate parents and content.
Maniphest Tasks: T13546, T12876
Differential Revision: https://secure.phabricator.com/D21324
Summary: Ref T13546. Make this output look more similar to other modern output.
Test Plan: Ran "arc land", saw consistent-looking output.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21319
Summary: Ref T13546. Communicate more progress information and provide additional details when merge conflicts occur.
Test Plan: Hit a merge conflict, saw more helpful output.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21318
Summary:
Ref T13546. When we find commits in history which are associated with already-closed revisions, and they weren't named explicitly on the command line, and we're using a squash strategy, discard them.
This generally happens when "feature2" is on top of "feature1", but "feature1" gets amended or branched elsewhere and lands independently.
Test Plan: Ran "arc land feature3" where prior revisions had already landed, got discards on the duplicated changes.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21322
Summary: Ref T13546. Small documentation fix. Mostly so I can have more things to land.
Test Plan: Ran "arc help land", saw help.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21321
Summary: Ref T13546. When "arc land" performs cascading rebases, do them in "feature1", "feature2", etc., order so they're easier to follow. The outcome is not dependent on execution order.
Test Plan: Landed a change which cascaded many other branches, saw more comprehensible update order.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21320
Summary: Ref T13546. This has a lot of dangerously rough edges, but has managed to land at least one commit in each Git and Mercurial.
Test Plan:
- Landed one commit under ideal conditions in Git and Mercurial.
- See followups.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21315
Summary:
Ref T13546. The new "arc land" workflow can rebase several branches per second. With branches like "feature1", "feature2", etc., this leads to out-of-order listing in "arc branch".
When two branches would otherwise sort to the same position, sort them by name.
Test Plan: Ran "arc branch" after a cascading rebase by "arc land", saw "land5", "land7", "land8", etc., instead of an arbitrary order.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21316
Summary: Ref T13544. This flag only disables a warning and should be a prompt default, not a flag.
Test Plan: Grepped for "ignore-unsound-tests", created this revision.
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21303
Summary:
Ref T13546. Resizing the terminal window to send SIGWINCH, or other signals, may interrupt "stream_select()" with an error which upgrades to a RuntimeException.
When "stream_select()" fails, continue and test the stream itself.
Test Plan: Waited for a prompt, resized the window. Before patch: SIGWINCH interruption. After patch: undisturbed prompt.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21317
Summary:
Ref T13546. Introduces a more structured construct for saving and restoring local repository state.
This is similar to old behavior, except that:
- "arc.autostash" is no longer respected;
- untracked changes are stashed; and
- we do not offer to amend.
Test Plan: In future changes, saved and restored various permutations of local state.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21314
Summary: Ref T13546. Adds modern support for "arc.land.onto", "arc.land.onto-remote", and "history.immutable".
Test Plan: Read configuration in a future change.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21313
Summary: Ref T13546. Prepares "arc land" to use hardpoint queries to load build information.
Test Plan: Ran `arc inspect --explore revision(1234)`, got a full related object tree including build information.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21312
Summary: Ref T13546. These are used by a future "arc land" workflow to support the "Land changes you don't own?" and "Land changes with open dependencies?" prompts.
Test Plan: Ran a future "arc land" flow, hit both prompts.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21311
Summary: See PHI1772. This is a quick patch to make some debugging/testing tasks easier until remaining workflows modernize. See T13490.
Test Plan: Ran `scripts/arcanist.php --library ...`, got the same behavior as `scripts/arcanist.php --load-phutil-library ...`.
Differential Revision: https://secure.phabricator.com/D21323
Summary: Ref T13544. This is an obscure flag and almost never useful. You can accomplish the same goal, roughly, with "git diff | arc diff --raw -". See also PHI675. See also T13338.
Test Plan: Grepped for "less-context", created this revision.
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21301
Summary: Ref T13544. This flag is generally questionable, likely has no actual uses, and is slated for obsoletion and replacement elsewhere (see T13338).
Test Plan: Grepped for "encoding", found no relevant hits.
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21300
Summary:
Ref T13544. These flags change the behavior of the "arc lint" subprocess.
I believe there is no reason to ever use "arc diff --lintall". If you want to find extra warnings to fix, you can use "arc lint --lintall" to express this intent.
Use of "arc diff --only-new" almost certainly means your linters are raising messages at "error" severity which should instead be raised at "warning" severity. If you only care about fixing a particular type of error in changed code, it should be raised as a "warning". The correct remedy is to adjust the severity, not use "--only-new", which is a very broad, slow, complicated hammer.
Test Plan: Searched for "lintall" and "only-new" in this workflow. These flags still exist in "arc lint", but may be changed in the future. Generated this change.
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21298
Summary:
Ref T13544. Long ago, "arc diff" started prompting the user to provide "excuses" when they submitted changes with failing lint or unit tests.
At the time, "arc" was generally more heavy-handed and the review workflow had fewer points where it provided feedback about lint and test issues.
As the workflow has evolved, there is now significantly more feedback (promotion behavior from Draft in Differential, warnings on "arc land", etc). These days, these prompts feel archaic and like they're just getting in the way.
When lint/unit have Harbormaster-triggered components, this prompt is also too early (since Harbormaster tests may fail or raise lint messages later). A modern version of this would look more like putting revisions in some kind of locked state until authors explain issues. It's possible that's worth building, but I'd like to see more interest in it. I suspect this feature is largely just a "nag" feature these days with few benefits.
Test Plan: Grepped for "advice", "excuse", "handleServerMessage", "sendMessage", "getSkipExcuse", "getErrorExcuse", got no hits. Generated this revision.
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21297
Summary:
Ref T13544. This flag was introduced in D1385 (2012) as part of a workflow which no longer exists. I can't recall anyone ever reporting an issue which involves its use and believe it is likely unused. It's not obvious to me why someone would use it in modern "arc".
(The same goal can be accomplished with "--message-file ...", although this requires more steps.)
Test Plan: Grepped for "use-commit-message" and "getCommitMessageFromCommit", ran "arc diff".
Maniphest Tasks: T13544
Differential Revision: https://secure.phabricator.com/D21296
Summary: Ref T13546. Add support for short "-x" flags and repeatable "--say moo --say quack" flags.
Test Plan: In future changes, used "arc diff -m" and "arc land --onto ... --onto ...".
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21310
Summary: Ref T13546. Future "arc land" workflows use this element to provide "hint" or "next step" suggestions to make error resolution easier.
Test Plan: Ran future "arc land" workflows, saw tips like "use --revision to do such-and-such" or "add these files to .gitignore".
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21309
Summary:
Ref T13546. Several substeps in the new "arc land" flow benefit from this. For example:
- When prompting "land revisions you don't own?", it's used to show authors.
- When prompting "land revisions in the wrong state?", it's used to show the current states.
Test Plan: Ran future "arc land" workflows, got relevant contextual information via this mechanism.
Maniphest Tasks: T13546
Differential Revision: https://secure.phabricator.com/D21308