RFR: cli: add trees command
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Fri Apr 24 12:41:26 UTC 2020
Interesting idea. I think you missed a proper implementation of tconfig,
though, if you want backwards compatibility:
magnusi at sthihse:/localhome/hg/jdk-ALT$ hg tconfig --help
hg tconfig [OPTION]... [SUBTREE]...
list or change the subtrees configuration
One of five operations can be selected:
--list : list the configured subtrees; this is the default if no
other
operation is selected.
--add : add the specified subtrees to the configuration.
--del : delete the specified subtrees from the configuration. Use
--del --all to delete all subtrees.
--set : set the subtree configuration to the specified
subtrees. Use
--set --walk to walk the filesystem rooted at REPO and set
the subtree configuration to the discovered repos. Use
--depth to write the subtree configuration depth-most, so
that each subtree is defined within the nearest enclosing
repository. Note that --walk and --depth may be used
together.
--expand : list the value of config items from the [trees]
section. Items
in the [trees] section can be defined in terms of other
items
in the [trees] section; tconfig --expand shows the
recursively expanded value. It returns 0 if at least one
config item was found; otherwise it returns 1.
Note that with the slight exception of --set --depth, this command does
not recurse into subtrees; it operates only on the current repository.
(To recursively list subtrees, use the tlist command.)
options:
-a --add add the specified SUBTREEs to config
--all with --del, delete all subtrees from config
-d --del delete the specified SUBTREEs from config
-e --expand recursively expand config items in the [trees] section
-l --list list the configured subtrees
--depth store subtree configuration depth-most
-s --set set the subtree config to SUBTREEs
--tns NAMESPACE trees namespace to use
-w --walk walk the filesystem to discover subtrees
--mq operate on patch repository
(some details hidden, use --verbose to show complete help)
Your code seems to do automatic configuration, which is probably an
improvment :-) (but not backwards compatibility).
It's also unclear what the "tconfig = tree config" alias means.
It's not at all clear that we want or need backwards compatibility here.
But if not, then the tconfig command should probably be removed.
/Magnus
On 2020-04-24 11:27, Erik Helin wrote:
> Hi all,
>
> please review this patch that adds
> [trees](https://hg.openjdk.java.net/code-tools/trees) functionality to Skara.
> This is mainly for those who want to use Skara for working with Mercurial today
> and are missing the trees functionality, but I also added a couple of trees
> "commands" like `tstatus`. `tpull` etc. to `skara.gitconfig`.
>
> Testing:
> - Manual testing of both Mercurial and Git trees commands
>
> Thanks,
> Erik
>
> -------------
>
> Commit messages:
> - cli: add trees command
>
> Changes: https://git.openjdk.java.net/skara/pull/599/files
> Webrev: https://webrevs.openjdk.java.net/skara/599/webrev.00
> Stats: 222 lines in 5 files changed: 210 ins; 0 del; 12 mod
> Patch: https://git.openjdk.java.net/skara/pull/599.diff
> Fetch: git fetch https://git.openjdk.java.net/skara pull/599/head:pull/599
>
> PR: https://git.openjdk.java.net/skara/pull/599
More information about the skara-dev
mailing list