# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 2009-11-17 21:16:41 # 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 --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1384,13 +1384,16 @@ class queue(object): 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 --git a/tests/test-mq b/tests/test-mq --- a/tests/test-mq +++ b/tests/test-mq @@ -143,8 +143,10 @@ echo % pop/push -a in subdir 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 --git a/tests/test-mq.out b/tests/test-mq.out --- a/tests/test-mq.out +++ b/tests/test-mq.out @@ -130,6 +130,8 @@ now at: test2.patch % 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