This is an archive of the discontinued Mercurial Phabricator instance.

scmutil: add utility fn to return repo object with user passed revs unhidden
ClosedPublic

Authored by pulkit on Dec 19 2017, 7:10 AM.

Details

Summary

There has been a need for accessing hidden changesets by default without passing
--hidden. This is currently done using the directaccess extension but is bit
hacky.

This patch adds a utility function to return a repo object having user passed
revisions unhidden. This functionality will live behind a
config option and won't be the default behaviour. There is also a config option
added by this patch which tells whether we want to unhide only those revisions
whose hashes are passed or should we consider revisions numbers also.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Dec 19 2017, 7:10 AM
yuja requested changes to this revision.Dec 19 2017, 9:18 AM
yuja added a subscriber: yuja.

Other than that, this one looks good.

mercurial/scmutil.py
1345

If visible- is required, we should probably check the filtername
of the source repo.

1346

And I slightly prefer a single function call that creates new filtered
repository with the given "exception" revs.

Otherwise, we might have to be careful to not keep a stale cache
that gets invalid on addvisibilityexceptions(revs).

This revision now requires changes to proceed.Dec 19 2017, 9:18 AM
pulkit added inline comments.Dec 22 2017, 8:03 AM
mercurial/scmutil.py
1345

Sorry I don't get you. Check the filtername of the source repo for what?

yuja added inline comments.Dec 22 2017, 8:52 AM
mercurial/scmutil.py
1345
repo = repo.filtered('served')
repo = unhidehashlikerevs(repo, ...)
repo.filtername == 'visible-hidden'

Does it make sense?

pulkit updated this revision to Diff 4585.Dec 22 2017, 12:57 PM
yuja accepted this revision.Dec 26 2017, 8:43 AM
This revision is now accepted and ready to land.Dec 26 2017, 8:43 AM
yuja added inline comments.Dec 26 2017, 8:51 AM
mercurial/scmutil.py
1322

It seems better to use an explicit list of filternames,
i.e. ('visible', 'visible-hidden'). I don't think we should introduce
new naming scheme, 'visible<x>'.

Can you send a followup?

This revision was automatically updated to reflect the committed changes.