# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1258492601 -3600 # Node ID c51494c538411b4e9c365445a6b0dcaf168e20b0 # Parent 541218fbad2a1b38dc1ff8c7b7a677159d615674 qseries: don't truncate the patch name (issue1912) Instead of truncating the entire output line of `qseries', only the summary is truncated. diff -r 541218fbad2a -r c51494c53841 hgext/mq.py --- a/hgext/mq.py Tue Nov 17 16:23:05 2009 -0600 +++ b/hgext/mq.py Tue Nov 17 22:16:41 2009 +0100 @@ -1384,13 +1384,16 @@ def displayname(pfx, patchname): if summary: ph = patchheader(self.join(patchname)) - msg = ph.message - msg = msg and ': ' + msg[0] or ': ' + msg = ph.message and ph.message[0] or '' + if self.ui.interactive(): + width = util.termwidth() - len(pfx) - len(patchname) - 2 + if width > 0: + msg = util.ellipsis(msg, width) + else: + msg = '' + msg = "%s%s: %s" % (pfx, patchname, msg) else: - msg = '' - msg = "%s%s%s" % (pfx, patchname, msg) - if self.ui.interactive(): - msg = util.ellipsis(msg, util.termwidth()) + msg = pfx + patchname self.ui.write(msg + '\n') applied = set([p.name for p in self.applied]) diff -r 541218fbad2a -r c51494c53841 tests/test-mq --- a/tests/test-mq Tue Nov 17 16:23:05 2009 -0600 +++ b/tests/test-mq Tue Nov 17 22:16:41 2009 +0100 @@ -143,8 +143,10 @@ hg qpop -a hg --traceback qpush -a +# setting columns & interactive tests truncating (issue1912) echo % qseries -hg qseries +COLUMNS=4 hg qseries --config ui.interactive=true +COLUMNS=20 hg qseries --config ui.interactive=true -vs hg qpop hg qseries -vs hg qpush diff -r 541218fbad2a -r c51494c53841 tests/test-mq.out --- a/tests/test-mq.out Tue Nov 17 16:23:05 2009 -0600 +++ b/tests/test-mq.out Tue Nov 17 22:16:41 2009 +0100 @@ -130,6 +130,8 @@ % qseries test.patch test2.patch +0 A test.patch: f... +1 A test2.patch: popping test2.patch now at: test.patch 0 A test.patch: foo bar