@@ -159,7 +159,7 @@ def _get_ghstack_message(ref: str) -> tuple[str, list[str]]:
159
159
if not urls :
160
160
raise PullError ("not a ghstack pull request" )
161
161
if len (urls ) > 1 :
162
- raise PullError ("Malformed ghstack pull requst " )
162
+ raise PullError (f "Malformed ghstack pull request { urls = } " )
163
163
164
164
end = next ((i for i , s in enumerate (lines ) if s .startswith (_GHSTACK_SOURCE )), - 1 )
165
165
lines = lines [:end ]
@@ -193,7 +193,8 @@ def pulls(self) -> dict[str, list[PullRequest]]:
193
193
for branch in _run ("git branch -r" ):
194
194
pr = PullRequest (branch .strip ())
195
195
with suppress (PullError ):
196
- result .setdefault (pr .user , []).append (pr )
196
+ if pr .user == self .user :
197
+ result .setdefault (pr .user , []).append (pr )
197
198
return result
198
199
199
200
def __call__ (self ) -> None :
@@ -213,7 +214,11 @@ def __call__(self) -> None:
213
214
try :
214
215
getattr (self , "_" + self .args .command , self ._url_command )()
215
216
except PullError as e :
216
- arg = getattr (self .args , "pull" , None ) or getattr (self .args , "search" , None )
217
+ arg = " " .join (
218
+ getattr (self .args , "pull" , None )
219
+ or getattr (self .args , "search" , None )
220
+ or ()
221
+ )
217
222
msg = e .args [0 ]
218
223
if arg and not arg in msg :
219
224
msg = f"{ msg } for { arg } "
@@ -362,7 +367,7 @@ def remotes(self):
362
367
363
368
@cached_property
364
369
def user (self ) -> str :
365
- if self .args . user :
370
+ if user := getattr ( self .args , " user" , None ) :
366
371
return self .args .user
367
372
if len (self .remotes ) != 1 :
368
373
return self .remotes ["origin" ]
@@ -640,7 +645,7 @@ def main():
640
645
try :
641
646
PullRequests ()()
642
647
except PullError as e :
643
- if DEBUG :
648
+ if DEBUG or VERBOSE :
644
649
raise
645
650
error (e .args [0 ])
646
651
0 commit comments