( )⚙ D175 sparse: add a config option to decide if paths are reporoot-relative

This is an archive of the discontinued Mercurial Phabricator instance.

sparse: add a config option to decide if paths are reporoot-relative
ClosedPublic

Authored by ikostia on Jul 21 2017, 2:31 PM.
Tags
None
Subscribers
None

Details

Summary

This adds two separate config knobs, one for include/exclude, one for enable/disable-profile. The reason for two separate options is that one is used much more frequently than the other, so migrating existing users for two usecases is a very different effort.

The config options have different defaults: it's cwd-relative for include/exclude and repo-root-relative for enable-disable.

Test Plan
  • rt

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Branch
default
Lint
Lint OK
Unit
Unit Tests OK

Event Timeline

ikostia created this revision.Jul 21 2017, 2:31 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 21 2017, 2:31 PM
mjpieters edited edge metadata.Jul 21 2017, 7:17 PM

With the current default, paths-always-relative-to-hgroot, the command-line UI is confusing for users, whom expect to be able to auto-complete paths from their current working dir instead. I know it is a breaking change, but I'd rather see the option be disabled by default instead.

ikostia planned changes to this revision.Jul 24 2017, 6:28 AM
ikostia updated this revision to Diff 388.Jul 24 2017, 7:18 AM

add another config option

ikostia edited the summary of this revision. (Show Details)Jul 24 2017, 7:23 AM
ikostia edited the summary of this revision. (Show Details)
mjpieters accepted this revision.Jul 25 2017, 11:13 AM
mjpieters added inline comments.
hgext3rd/sparse.py
755–756

Please use parentheses and not a backslash to continue lines:

if (not ui.configbool('sparse', 'includereporootpaths', False)
    and (include or exclude)):
761–762

ditto

This revision is now accepted and ready to land.Jul 25 2017, 11:13 AM
This revision was automatically updated to reflect the committed changes.