##// END OF EJS Templates
histedit: Show file names in multiple line format
Yu Feng -
r42418:4ad19104 default
parent child Browse files
Show More
@@ -1227,6 +1227,15 b' def addln(win, y, x, line, color=None):'
1227 else:
1227 else:
1228 win.addstr(y, x, line)
1228 win.addstr(y, x, line)
1229
1229
1230 def _trunc_head(line, n):
1231 if len(line) <= n:
1232 return line
1233 return '> ' + line[-(n - 2):]
1234 def _trunc_tail(line, n):
1235 if len(line) <= n:
1236 return line
1237 return line[:n - 2] + ' >'
1238
1230 def patchcontents(state):
1239 def patchcontents(state):
1231 repo = state['repo']
1240 repo = state['repo']
1232 rule = state['rules'][state['pos']]
1241 rule = state['rules'][state['pos']]
@@ -1284,11 +1293,23 b' def _chisteditmain(repo, rules, stdscr):'
1284 line = "bookmark: {0}".format(' '.join(bms))
1293 line = "bookmark: {0}".format(' '.join(bms))
1285 win.addstr(3, 1, line[:length])
1294 win.addstr(3, 1, line[:length])
1286
1295
1287 line = "files: {0}".format(','.join(ctx.files()))
1296 line = "summary: {0}".format(ctx.description().splitlines()[0])
1288 win.addstr(4, 1, line[:length])
1297 win.addstr(4, 1, line[:length])
1289
1298
1290 line = "summary: {0}".format(ctx.description().splitlines()[0])
1299 line = "files: "
1291 win.addstr(5, 1, line[:length])
1300 win.addstr(5, 1, line)
1301 fnx = 1 + len(line)
1302 fnmaxx = length - fnx + 1
1303 y = 5
1304 fnmaxn = maxy - (1 + y) - 1
1305 files = ctx.files()
1306 for i, line1 in enumerate(files):
1307 if len(files) > fnmaxn and i == fnmaxn - 1:
1308 win.addstr(y, fnx, _trunc_tail(','.join(files[i:]), fnmaxx))
1309 y = y + 1
1310 break
1311 win.addstr(y, fnx, _trunc_head(line1, fnmaxx))
1312 y = y + 1
1292
1313
1293 conflicts = rule.conflicts
1314 conflicts = rule.conflicts
1294 if len(conflicts) > 0:
1315 if len(conflicts) > 0:
@@ -1297,7 +1318,7 b' def _chisteditmain(repo, rules, stdscr):'
1297 else:
1318 else:
1298 conflictstr = 'no overlap'
1319 conflictstr = 'no overlap'
1299
1320
1300 win.addstr(6, 1, conflictstr[:length])
1321 win.addstr(y, 1, conflictstr[:length])
1301 win.noutrefresh()
1322 win.noutrefresh()
1302
1323
1303 def helplines(mode):
1324 def helplines(mode):
@@ -1379,9 +1400,9 b' pgup/K: move patch up, pgdn/J: move patc'
1379 maxy, maxx = stdscr.getmaxyx()
1400 maxy, maxx = stdscr.getmaxyx()
1380 helplen = len(helplines(mode))
1401 helplen = len(helplines(mode))
1381 return {
1402 return {
1382 'commit': (8, maxx),
1403 'commit': (12, maxx),
1383 'help': (helplen, maxx),
1404 'help': (helplen, maxx),
1384 'main': (maxy - helplen - 8, maxx),
1405 'main': (maxy - helplen - 12, maxx),
1385 }
1406 }
1386
1407
1387 def drawvertwin(size, y, x):
1408 def drawvertwin(size, y, x):
General Comments 0
You need to be logged in to leave comments. Login now