summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9b4a6e7)
... so that they fit nicely in an 80-column terminal. This makes it
unnecessary to embed newlines and extra spaces in a few places.
This patch only wraps the text of tagged output messages. I haven't
found a reason to wrap other messages, but I haven't looked long and
hard.
Signed-off-by: Karl Hasselström <kha@treskal.com>
def check_local_changes():
if git.local_changes():
def check_local_changes():
if git.local_changes():
- raise CmdException, \
- 'local changes in the tree. Use "refresh" or "status --reset"'
+ raise CmdException('local changes in the tree. Use "refresh" or'
+ ' "status --reset"')
def check_head_top_equal(crt_series):
if not crt_series.head_top_equal():
def check_head_top_equal(crt_series):
if not crt_series.head_top_equal():
- raise CmdException(
-"""HEAD and top are not the same. This can happen if you
- modify a branch with git. "stg repair --help" explains
- more about what to do next.""")
+ raise CmdException('HEAD and top are not the same. This can happen'
+ ' if you modify a branch with git. "stg repair'
+ ' --help" explains more about what to do next.')
def check_conflicts():
if git.get_conflicts():
def check_conflicts():
if git.get_conflicts():
- raise CmdException, \
- 'Unsolved conflicts. Please resolve them first or\n' \
- ' revert the changes with "status --reset"'
+ raise CmdException('Unsolved conflicts. Please resolve them first'
+ ' or revert the changes with "status --reset"')
def print_crt_patch(crt_series, branch = None):
if not branch:
def print_crt_patch(crt_series, branch = None):
if not branch:
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
class MessagePrinter(object):
def __init__(self):
class MessagePrinter(object):
def __init__(self):
self.at_start_of_line = False
def tagged_lines(self, tag, lines):
tag += ': '
self.at_start_of_line = False
def tagged_lines(self, tag, lines):
tag += ': '
+ width = 79 - 2*self.level - len(tag)
+ lines = [wl for line in lines
+ for wl in textwrap.wrap(line, width,
+ break_long_words = False)]
for line in lines:
self.single_line(tag + line)
tag = ' '*len(tag)
for line in lines:
self.single_line(tag + line)
tag = ' '*len(tag)