public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8081] branch_changer: distinguish terminal output
@ 2021-04-09 11:40 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-04-09 11:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7d7481ecbcb689e1120d4d22d6ede18769fbcb5a

commit r11-8081-g7d7481ecbcb689e1120d4d22d6ede18769fbcb5a
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Apr 9 13:39:30 2021 +0200

    branch_changer: distinguish terminal output
    
    maintainer-scripts/ChangeLog:
    
            * branch_changer.py: Generate URL only when emitting
            to terminal.

Diff:
---
 maintainer-scripts/branch_changer.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/maintainer-scripts/branch_changer.py b/maintainer-scripts/branch_changer.py
index 118b6faf4f1..370d92d85da 100755
--- a/maintainer-scripts/branch_changer.py
+++ b/maintainer-scripts/branch_changer.py
@@ -47,6 +47,7 @@
 import argparse
 import json
 import re
+import sys
 
 import requests
 
@@ -83,7 +84,10 @@ class Bug:
     def name(self):
         bugid = self.data['id']
         url = f'https://gcc.gnu.org/bugzilla/show_bug.cgi?id={bugid}'
-        return f'\u001b]8;;{url}\u001b\\PR{bugid}\u001b]8;;\u001b\\ ({self.data["summary"]})'
+        if sys.stdout.isatty():
+            return f'\u001b]8;;{url}\u001b\\PR{bugid}\u001b]8;;\u001b\\ ({self.data["summary"]})'
+        else:
+            return f'PR{bugid} ({self.data["summary"]})'
 
     def remove_release(self, release):
         self.versions = list(filter(lambda x: x != release, self.versions))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-09 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 11:40 [gcc r11-8081] branch_changer: distinguish terminal output Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).