Patchwork D8632: debugcommands: introduce new debugrequirements command

login
register
mail settings
Submitter phabricator
Date June 15, 2020, 3:04 p.m.
Message ID <differential-rev-PHID-DREV-asrtcfuoz4ew3qle5v2e-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46504/
State New
Headers show

Comments

phabricator - June 15, 2020, 3:04 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This for now just prints out the list of current requirements. In future this
  will be helpful in reading requirements from couple of sources, and checking
  which requirement comes from where.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/debugcommands.py
  tests/test-completion.t
  tests/test-help.t
  tests/test-requires.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -48,6 +48,14 @@ 
   > # enable extension locally
   > supportlocally = $TESTTMP/supported-locally/supportlocally.py
   > EOF
+  $ hg -R supported debugrequirements
+  dotencode
+  featuresetup-test
+  fncache
+  generaldelta
+  revlogv1
+  sparserevlog
+  store
   $ hg -R supported status
 
   $ hg init push-dst
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1051,6 +1051,8 @@ 
    debugrebuildfncache
                  rebuild the fncache file
    debugrename   dump rename information
+   debugrequires
+                 print the current repo requirements
    debugrevlog   show data and statistics about a revlog
    debugrevlogindex
                  dump the contents of a revlog index
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -121,6 +121,7 @@ 
   debugrebuilddirstate
   debugrebuildfncache
   debugrename
+  debugrequires
   debugrevlog
   debugrevlogindex
   debugrevspec
@@ -306,6 +307,7 @@ 
   debugrebuilddirstate: rev, minimal
   debugrebuildfncache: 
   debugrename: rev
+  debugrequires: 
   debugrevlog: changelog, manifest, dir, dump
   debugrevlogindex: changelog, manifest, dir, format
   debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2651,6 +2651,13 @@ 
             ui.write(_(b"%s not renamed\n") % rel)
 
 
+@command(b'debugrequires|debugrequirements', [], b'')
+def debugrequirements(ui, repo):
+    """ print the current repo requirements """
+    for r in sorted(repo.requirements):
+        ui.write(b"%s\n" % r)
+
+
 @command(
     b'debugrevlog',
     cmdutil.debugrevlogopts + [(b'd', b'dump', False, _(b'dump index data'))],