##// END OF EJS Templates
merge with stable
Matt Mackall -
r14759:c64bd320 merge default
parent child Browse files
Show More
@@ -0,0 +1,27 b''
1 hgterm,
2 am, km, mir, msgr, xenl,
3 colors#8, cols#80, it#8, lines#24, pairs#64,
4 acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
5 bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
6 csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b,
7 cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
8 cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
9 dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
10 ed=\E[J, el=\E[K, enacs=\E)0, home=\E[H, ht=\t,
11 hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=\n,
12 is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=\b,
13 kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
14 kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
15 kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
16 kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
17 kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
18 kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
19 kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M,
20 knp=\E[6~, kpp=\E[5~, kslt=\E[4~, op=\E[m, rc=\E8,
21 rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
22 rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
23 rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, sc=\E7,
24 setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m,
25 smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
26 smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
27 u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
@@ -144,8 +144,11 b' def _terminfosetup(ui, mode):'
144 144 ui.debug("no terminfo entry for %s\n" % e)
145 145 del _terminfo_params[key]
146 146 if not curses.tigetstr('setaf') or not curses.tigetstr('setab'):
147 ui.warn(_("no terminfo entry for setab/setaf: reverting to "
148 "ECMA-48 color\n"))
147 # Only warn about missing terminfo entries if we explicitly asked for
148 # terminfo mode.
149 if mode == "terminfo":
150 ui.warn(_("no terminfo entry for setab/setaf: reverting to "
151 "ECMA-48 color\n"))
149 152 _terminfo_params = {}
150 153
151 154 def _modesetup(ui, opts):
@@ -4184,17 +4184,22 b' def revert(ui, repo, *pats, **opts):'
4184 4184
4185 4185 if not pats and not opts.get('all'):
4186 4186 msg = _("no files or directories specified")
4187 hint = _("use --all to discard all changes")
4188 4187 if p2 != nullid:
4189 4188 hint = _("uncommitted merge, use --all to discard all changes,"
4190 4189 " or 'hg update -C .' to abort the merge")
4191 elif node != parent:
4192 if util.any(repo.status()):
4190 raise util.Abort(msg, hint=hint)
4191 dirty = util.any(repo.status())
4192 if node != parent:
4193 if dirty:
4193 4194 hint = _("uncommitted changes, use --all to discard all"
4194 4195 " changes, or 'hg update %s' to update") % ctx.rev()
4195 4196 else:
4196 4197 hint = _("use --all to revert all files,"
4197 4198 " or 'hg update %s' to update") % ctx.rev()
4199 elif dirty:
4200 hint = _("uncommitted changes, use --all to discard all changes")
4201 else:
4202 hint = _("use --all to revert all files")
4198 4203 raise util.Abort(msg, hint=hint)
4199 4204
4200 4205 mf = ctx.manifest()
@@ -143,6 +143,7 b' class server(object):'
143 143 logfile = open(logpath, 'a')
144 144
145 145 self.repo = repo
146 self.repoui = repo.ui
146 147
147 148 if mode == 'pipe':
148 149 self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e')
@@ -176,8 +177,13 b' class server(object):'
176 177 else:
177 178 args = self._read(length).split('\0')
178 179
179 # copy the ui so changes to it don't persist between requests
180 req = dispatch.request(args, self.ui.copy(), self.repo, self.cin,
180 # copy the uis so changes (e.g. --config or --verbose) don't
181 # persist between requests
182 copiedui = self.ui.copy()
183 self.repo.baseui = copiedui
184 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
185
186 req = dispatch.request(args, copiedui, self.repo, self.cin,
181 187 self.cout, self.cerr)
182 188
183 189 ret = dispatch.dispatch(req) or 0 # might return None
@@ -398,6 +398,8 b' def _parse(ui, args):'
398 398
399 399 def _parseconfig(ui, config):
400 400 """parse the --config options from the command line"""
401 configs = []
402
401 403 for cfg in config:
402 404 try:
403 405 name, value = cfg.split('=', 1)
@@ -405,10 +407,13 b' def _parseconfig(ui, config):'
405 407 if not section or not name:
406 408 raise IndexError
407 409 ui.setconfig(section, name, value)
410 configs.append((section, name, value))
408 411 except (IndexError, ValueError):
409 412 raise util.Abort(_('malformed --config option: %r '
410 413 '(use --config section.name=value)') % cfg)
411 414
415 return configs
416
412 417 def _earlygetopt(aliases, args):
413 418 """Return list of values for an option (or aliases).
414 419
@@ -525,7 +530,7 b' def _dispatch(req):'
525 530
526 531 # read --config before doing anything else
527 532 # (e.g. to change trust settings for reading .hg/hgrc)
528 _parseconfig(ui, _earlygetopt(['--config'], args))
533 cfgs = _parseconfig(ui, _earlygetopt(['--config'], args))
529 534
530 535 # check for cwd
531 536 cwd = _earlygetopt(['--cwd'], args)
@@ -592,20 +597,27 b' def _dispatch(req):'
592 597 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
593 598 atexit.register(print_time)
594 599
595 if options['verbose'] or options['debug'] or options['quiet']:
596 for ui_ in (ui, lui):
597 ui_.setconfig('ui', 'verbose', str(bool(options['verbose'])))
598 ui_.setconfig('ui', 'debug', str(bool(options['debug'])))
599 ui_.setconfig('ui', 'quiet', str(bool(options['quiet'])))
600 if options['traceback']:
601 for ui_ in (ui, lui):
602 ui_.setconfig('ui', 'traceback', 'on')
600 uis = set([ui, lui])
601
602 if req.repo:
603 uis.add(req.repo.ui)
604
605 # copy configs that were passed on the cmdline (--config) to the repo ui
606 for cfg in cfgs:
607 req.repo.ui.setconfig(*cfg)
608
609 for opt in ('verbose', 'debug', 'quiet', 'traceback'):
610 val = bool(options[opt])
611 if val:
612 for ui_ in uis:
613 ui_.setconfig('ui', opt, str(val))
614
603 615 if options['noninteractive']:
604 for ui_ in (ui, lui):
616 for ui_ in uis:
605 617 ui_.setconfig('ui', 'interactive', 'off')
606 618
607 619 if cmdoptions.get('insecure', False):
608 for ui_ in (ui, lui):
620 for ui_ in uis:
609 621 ui_.setconfig('web', 'cacerts', '')
610 622
611 623 if options['help']:
@@ -233,7 +233,8 b' def filemerge(repo, mynode, orig, fcd, f'
233 233 replace = dict(local=a, base=b, other=c, output=out)
234 234 args = util.interpolate(r'\$', replace, args,
235 235 lambda s: '"%s"' % util.localpath(s))
236 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
236 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env,
237 out=ui.fout)
237 238
238 239 if not r and (_toolbool(ui, tool, "checkconflicts") or
239 240 'conflicts' in _toollist(ui, tool, "check")):
@@ -1773,7 +1773,7 b' class localrepository(repo.repository):'
1773 1773
1774 1774 # process the files
1775 1775 self.ui.status(_("adding file changes\n"))
1776 pr.step = 'files'
1776 pr.step = _('files')
1777 1777 pr.count = 1
1778 1778 pr.total = efiles
1779 1779 source.callback = None
@@ -54,6 +54,12 b' issue1829: wrong indentation'
54 54 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
55 55 $ unset FAKEPATH
56 56
57 make sure unspecified global ui options don't override old values
58
59 $ hg showconfig --config ui.verbose=True --quiet
60 ui.verbose=True
61 ui.quiet=True
62
57 63 username expansion
58 64
59 65 $ olduser=$HGUSER
@@ -134,9 +140,7 b' plain hgrc'
134 140 $ hg showconfig --config ui.traceback=True --debug
135 141 read config from: $TESTTMP/hgrc
136 142 none: ui.traceback=True
137 none: ui.verbose=False
138 143 none: ui.debug=True
139 none: ui.quiet=False
140 144
141 145 plain mode with exceptions
142 146
@@ -152,24 +156,18 b' plain mode with exceptions'
152 156 read config from: $TESTTMP/hgrc
153 157 $TESTTMP/hgrc:15: extensions.plain=./plain.py
154 158 none: ui.traceback=True
155 none: ui.verbose=False
156 159 none: ui.debug=True
157 none: ui.quiet=False
158 160 $ unset HGPLAIN
159 161 $ hg showconfig --config ui.traceback=True --debug
160 162 plain: True
161 163 read config from: $TESTTMP/hgrc
162 164 $TESTTMP/hgrc:15: extensions.plain=./plain.py
163 165 none: ui.traceback=True
164 none: ui.verbose=False
165 166 none: ui.debug=True
166 none: ui.quiet=False
167 167 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
168 168 $ hg showconfig --config ui.traceback=True --debug
169 169 plain: True
170 170 read config from: $TESTTMP/hgrc
171 171 $TESTTMP/hgrc:15: extensions.plain=./plain.py
172 172 none: ui.traceback=True
173 none: ui.verbose=False
174 173 none: ui.debug=True
175 none: ui.quiet=False
@@ -10,7 +10,7 b' nothing changed'
10 10
11 11 $ hg revert
12 12 abort: no files or directories specified
13 (use --all to discard all changes)
13 (use --all to revert all files)
14 14 [255]
15 15
16 16 $ echo 123 > b
@@ -167,7 +167,9 b' hg status -A:'
167 167
168 168 hg status -A (with terminfo color):
169 169
170 $ TERM=xterm hg status --config color.mode=terminfo --color=always -A
170 $ mkdir $TESTTMP/terminfo
171 $ TERMINFO=$TESTTMP/terminfo tic $TESTDIR/hgterm.ti
172 $ TERM=hgterm TERMINFO=$TESTTMP/terminfo hg status --config color.mode=terminfo --color=always -A
171 173 \x1b[30m\x1b[32m\x1b[1mA added\x1b[30m (esc)
172 174 \x1b[30m\x1b[32m\x1b[1mA copied\x1b[30m (esc)
173 175 \x1b[30m\x1b[30m modified\x1b[30m (esc)
General Comments 0
You need to be logged in to leave comments. Login now