`--list-trains` shouldn't require a commit range
Categories
(Conduit :: moz-phab, defect, P3)
Tracking
(Not tracked)
People
(Reporter: glob, Unassigned)
References
(Blocks 1 open bug)
Details
Obtaining a list of possible trains currently requires viable commits to uplift; this is unexpected.
If possible it should just list all possible trains, instead of:
$ moz-phab uplift --list-trains
Failed to find draft commits to submit
or worse:
$ moz-phab uplift --list-trains
!! Found multiple upstreams (mozilla, try).
Determining the commit range using upstream "mozilla"
fatal: unknown commit mozilla
Determining the commit range using upstream "try"
fatal: unknown commit try
Unable to detect the start commit. Please provide its SHA-1 or
specify the upstream branch with `--upstream <branch>`.
Comment 1•2 years ago
|
||
I took a brief look at trying to fix this. It's happening because we re-use the command arguments from moz-phab submit in moz-phab uplift, and in moz-phab submit we use a default value for the start_rev argument. Then when we are building the Repository object from arguments, that value is set and by default we try to find a revision range.
I attempted to fix this by making --list-trains a mutually exclusive argument against a group containing all the other arguments for moz-phab uplift, however argparse doesn't support making a group of arguments mutually exclusive with another single argument. Alternative solutions:
- Make the
--list-trainsargument a subcommand, likemoz-phab uplift list-trains, so the parser detects it as a completely separate command and the default argument forstart_revis never set. - Decouple the
moz-phab submitarguments from the code that detects the revision range in ourRepositorysubclasses. This solution is more ideal but is also more work.
Description
•