comparison mercurial/commands.py @ 7695:deec6628e62b

Also find correct column width of wide characters. Use unicodedata.east_asian_width() to determine wide/full width characters if available. Otherwise, return character count as before.
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Wed, 21 Jan 2009 20:29:47 +0900
parents e040f9d6b2f3
children 9f73bddb9d0b 26bdb7109170
comparison
equal deleted inserted replaced
7694:2ceeb1423544 7695:deec6628e62b
446 notice = '' 446 notice = ''
447 elif hn not in repo.branchheads(tag, closed=False): 447 elif hn not in repo.branchheads(tag, closed=False):
448 notice = ' (closed)' 448 notice = ' (closed)'
449 else: 449 else:
450 notice = ' (inactive)' 450 notice = ' (inactive)'
451 rev = str(node).rjust(31 - util.locallen(tag)) 451 rev = str(node).rjust(31 - util.colwidth(tag))
452 data = tag, rev, hexfunc(hn), notice 452 data = tag, rev, hexfunc(hn), notice
453 ui.write("%s %s:%s%s\n" % data) 453 ui.write("%s %s:%s%s\n" % data)
454 454
455 def bundle(ui, repo, fname, dest=None, **opts): 455 def bundle(ui, repo, fname, dest=None, **opts):
456 """create a changegroup file 456 """create a changegroup file
2831 hn = hexfunc(n) 2831 hn = hexfunc(n)
2832 r = "%5d:%s" % (repo.changelog.rev(n), hn) 2832 r = "%5d:%s" % (repo.changelog.rev(n), hn)
2833 except error.LookupError: 2833 except error.LookupError:
2834 r = " ?:%s" % hn 2834 r = " ?:%s" % hn
2835 else: 2835 else:
2836 spaces = " " * (30 - util.locallen(t)) 2836 spaces = " " * (30 - util.colwidth(t))
2837 if ui.verbose: 2837 if ui.verbose:
2838 if repo.tagtype(t) == 'local': 2838 if repo.tagtype(t) == 'local':
2839 tagtype = " local" 2839 tagtype = " local"
2840 else: 2840 else:
2841 tagtype = "" 2841 tagtype = ""