所以 google 建議修改成:
diff --git a/subcmds/help.py b/subcmds/help.py
index 1e16019..9c4756b 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -17,7 +17,7 @@
from __future__ import print_function
import re
import sys
-from formatter import AbstractFormatter, DumbWriter
+import textwrap
from subcmds import all_commands
from color import Coloring
@@ -88,7 +88,7 @@ Displays detailed usage information about a command.
Coloring.__init__(self, gc, 'help')
self.heading = self.printer('heading', attr='bold')
- self.wrap = AbstractFormatter(DumbWriter())
+ self._first = True
def _PrintSection(self, heading, bodyAttr):
try:
@@ -123,9 +123,12 @@ Displays detailed usage information about a command.
self.nl()
continue
- self.wrap.add_flowing_data(para)
- self.wrap.end_paragraph(1)
- self.wrap.end_paragraph(0)
+ lines = textwrap.warp(para.replace(' ',' '), width=80, break_long_word=False, break_on_hyphens=False)
+
+ for line in lines:
+ self.write('%s',line)
+ self.nl()
+ self.nl()
out = _Out(self.manifest.globalConfig)
out._PrintSection('Summary', 'helpSummary')
其實可以去 .repo/repo 下面,加入 git-repo 做remote source,然後 checkout 一個新版也可以
git remote add gitrepo https://github.com/GerritCodeReview/git-repo git fetch gitrepo git checkout v2.29.. 因為這個 repo mirror 最小的 tag 好像只有 v2.29,沒有更早的。
沒有留言:
張貼留言