ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/cli
Martin von Zweigbergk 3b702250a6 repo_path: add type for formatting and parsing RepoPath, use in CLI
We want to move UI-independent logic that's currently in `jj-cli` into
`jj-lib`. `WorkspaceCommandHelper` is perhaps the most important part
to start moving. As I was looking into what to move from
`WorkspaceCommandHelper`, the first thing I saw there was the
`cwd`. It might seem like a good candidate to start moving. However,
when running a server, you might be running operations on repos stored
in database, so `cwd` and the workspace root don't make sense then
(because the repo is not stored at a particular path).

So, instead, this patch starts abstracting out our uses of those two
paths by adding an enum for converting between `RepoPath` and paths as
they are presented in the UI. I added a variant for repos stored in a
file system, and made `WorkspaceCommandHelper` use that to show that
it works. We'll probably add a server variant later.

I put the new type in `repo_path.rs` because at least the
file-system-based implementation is closely related to
`RepoPath::parse_fs_path()`.
2024-05-28 21:36:40 -07:00
..
examples templater: implement expect_*_arguments() as methods 2024-05-22 10:18:05 +09:00
src repo_path: add type for formatting and parsing RepoPath, use in CLI 2024-05-28 21:36:40 -07:00
testing
tests conflicts: consider the empty tree a non-legacy tree 2024-05-27 06:25:27 -07:00
build.rs
Cargo.toml
LICENSE