Patchwork D8214: phabricator: make `hg phabread` work outside of a repository

login
register
mail settings
Submitter phabricator
Date March 4, 2020, 3:27 p.m.
Message ID <differential-rev-PHID-DREV-bkz7mbn57hal7uzq4eb2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45462/
State Superseded
Headers show

Comments

phabricator - March 4, 2020, 3:27 p.m.
mharbison72 created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is similar to 16312ea45a8b <https://phab.mercurial-scm.org/rHG16312ea45a8b766b20961d943181a52236386579> and 2513f0f70a26 <https://phab.mercurial-scm.org/rHG2513f0f70a26b402f06c56909563bd09e328d639>- we don't need a repo, but will
  load .hg/hgrc if inside one.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1655,6 +1655,7 @@ 
     [(b'', b'stack', False, _(b'read dependencies'))],
     _(b'DREVSPEC [OPTIONS]'),
     helpcategory=command.CATEGORY_IMPORT_EXPORT,
+    optionalrepo=True,
 )
 def phabread(ui, repo, spec, **opts):
     """print patches from Phabricator suitable for importing
@@ -1678,13 +1679,13 @@ 
     opts = pycompat.byteskwargs(opts)
     if opts.get(b'stack'):
         spec = b':(%s)' % spec
-    drevs = querydrev(repo.ui, spec)
+    drevs = querydrev(ui, spec)
 
     def _write(patches):
         for drev, content in patches:
             ui.write(content)
 
-    readpatch(repo.ui, drevs, _write)
+    readpatch(ui, drevs, _write)
 
 
 @vcrcommand(