Patchwork D11883: directaccess: fix uses of commands.status() that don't go through flag parsing

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2021, 11:57 p.m.
Message ID <differential-rev-PHID-DREV-uv5zambzpswyrtvclh7e-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50210/
State New
Headers show

Comments

phabricator - Dec. 7, 2021, 11:57 p.m.
spectral created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When `commands.commit.post-status` is enabled, after commit/amend,
  commands.status() is called without any revs argument, which means that status
  gets None instead of an empty list like it would receive if the user had invoked
  this on the commandline. With the `experimental.directaccess` config enabled,
  this gets passed to `unhidehashlikerevs`, which didn't previously handle None,
  but now should.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11883

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -2197,6 +2197,9 @@ 
 
     returns a repo object with the required changesets unhidden
     """
+    if not specs:
+        return repo
+
     if not repo.filtername or not repo.ui.configbool(
         b'experimental', b'directaccess'
     ):