Show More
@@ -126,7 +126,8 b' def reposetup(ui, repo):' | |||||
126 | if not repo.local(): |
|
126 | if not repo.local(): | |
127 | return |
|
127 | return | |
128 |
|
128 | |||
129 | ui.setrepo(repo) |
|
129 | if util.safehasattr(ui, 'setrepo'): | |
|
130 | ui.setrepo(repo) | |||
130 |
|
131 | |||
131 | @command('^blackbox', |
|
132 | @command('^blackbox', | |
132 | [('l', 'limit', 10, _('the number of events to show')), |
|
133 | [('l', 'limit', 10, _('the number of events to show')), |
@@ -1325,6 +1325,8 b' def commit(ui, repo, *pats, **opts):' | |||||
1325 | Returns 0 on success, 1 if nothing changed. |
|
1325 | Returns 0 on success, 1 if nothing changed. | |
1326 | """ |
|
1326 | """ | |
1327 | if opts.get('subrepos'): |
|
1327 | if opts.get('subrepos'): | |
|
1328 | if opts.get('amend'): | |||
|
1329 | raise util.Abort(_('cannot amend with --subrepos')) | |||
1328 | # Let --subrepos on the command line override config setting. |
|
1330 | # Let --subrepos on the command line override config setting. | |
1329 | ui.setconfig('ui', 'commitsubrepos', True) |
|
1331 | ui.setconfig('ui', 'commitsubrepos', True) | |
1330 |
|
1332 | |||
@@ -1337,7 +1339,7 b' def commit(ui, repo, *pats, **opts):' | |||||
1337 |
|
1339 | |||
1338 | if opts.get('amend'): |
|
1340 | if opts.get('amend'): | |
1339 | if ui.configbool('ui', 'commitsubrepos'): |
|
1341 | if ui.configbool('ui', 'commitsubrepos'): | |
1340 |
raise util.Abort(_('cannot amend |
|
1342 | raise util.Abort(_('cannot amend with ui.commitsubrepos enabled')) | |
1341 |
|
1343 | |||
1342 | old = repo['.'] |
|
1344 | old = repo['.'] | |
1343 | if old.phase() == phases.public: |
|
1345 | if old.phase() == phases.public: |
@@ -62,7 +62,16 b' def dispatch(req):' | |||||
62 | ferr.write(_("hg: parse error: %s\n") % inst.args[0]) |
|
62 | ferr.write(_("hg: parse error: %s\n") % inst.args[0]) | |
63 | return -1 |
|
63 | return -1 | |
64 |
|
64 | |||
65 | return _runcatch(req) |
|
65 | msg = ' '.join(' ' in a and repr(a) or a for a in req.args) | |
|
66 | starttime = time.time() | |||
|
67 | ret = None | |||
|
68 | try: | |||
|
69 | ret = _runcatch(req) | |||
|
70 | return ret | |||
|
71 | finally: | |||
|
72 | duration = time.time() - starttime | |||
|
73 | req.ui.log("commandfinish", "%s exited %s after %0.2f seconds\n", | |||
|
74 | msg, ret or 0, duration) | |||
66 |
|
75 | |||
67 | def _runcatch(req): |
|
76 | def _runcatch(req): | |
68 | def catchterm(*args): |
|
77 | def catchterm(*args): | |
@@ -764,16 +773,10 b' def _dispatch(req):' | |||||
764 | msg = ' '.join(' ' in a and repr(a) or a for a in fullargs) |
|
773 | msg = ' '.join(' ' in a and repr(a) or a for a in fullargs) | |
765 | ui.log("command", '%s\n', msg) |
|
774 | ui.log("command", '%s\n', msg) | |
766 | d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) |
|
775 | d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) | |
767 | starttime = time.time() |
|
|||
768 | ret = None |
|
|||
769 | try: |
|
776 | try: | |
770 |
ret |
|
777 | return runcommand(lui, repo, cmd, fullargs, ui, options, d, | |
771 | cmdpats, cmdoptions) |
|
778 | cmdpats, cmdoptions) | |
772 | return ret |
|
|||
773 | finally: |
|
779 | finally: | |
774 | duration = time.time() - starttime |
|
|||
775 | ui.log("commandfinish", "%s exited %s after %0.2f seconds\n", |
|
|||
776 | cmd, ret, duration) |
|
|||
777 | if repo and repo != req.repo: |
|
780 | if repo and repo != req.repo: | |
778 | repo.close() |
|
781 | repo.close() | |
779 |
|
782 |
@@ -26,7 +26,7 b' command, exit codes, and duration' | |||||
26 | $ hg add a |
|
26 | $ hg add a | |
27 | $ hg blackbox |
|
27 | $ hg blackbox | |
28 | 1970/01/01 00:00:00 bob> add a |
|
28 | 1970/01/01 00:00:00 bob> add a | |
29 | 1970/01/01 00:00:00 bob> add exited 0 after * seconds (glob) |
|
29 | 1970/01/01 00:00:00 bob> add a exited 0 after * seconds (glob) | |
30 |
|
30 | |||
31 | incoming change tracking |
|
31 | incoming change tracking | |
32 |
|
32 | |||
@@ -58,7 +58,7 b' clone, commit, pull' | |||||
58 | $ hg blackbox -l 3 |
|
58 | $ hg blackbox -l 3 | |
59 | 1970/01/01 00:00:00 bob> pull |
|
59 | 1970/01/01 00:00:00 bob> pull | |
60 | 1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62 |
|
60 | 1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62 | |
61 |
1970/01/01 00:00:00 bob> pull exited |
|
61 | 1970/01/01 00:00:00 bob> pull exited 0 after * seconds (glob) | |
62 |
|
62 | |||
63 | we must not cause a failure if we cannot write to the log |
|
63 | we must not cause a failure if we cannot write to the log | |
64 |
|
64 | |||
@@ -118,7 +118,7 b' backup bundles get logged' | |||||
118 | $ hg blackbox -l 3 |
|
118 | $ hg blackbox -l 3 | |
119 | 1970/01/01 00:00:00 bob> strip tip |
|
119 | 1970/01/01 00:00:00 bob> strip tip | |
120 | 1970/01/01 00:00:00 bob> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) |
|
120 | 1970/01/01 00:00:00 bob> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) | |
121 | 1970/01/01 00:00:00 bob> strip exited 0 after * seconds (glob) |
|
121 | 1970/01/01 00:00:00 bob> strip tip exited 0 after * seconds (glob) | |
122 |
|
122 | |||
123 | extension and python hooks - use the eol extension for a pythonhook |
|
123 | extension and python hooks - use the eol extension for a pythonhook | |
124 |
|
124 | |||
@@ -133,7 +133,7 b' extension and python hooks - use the eol' | |||||
133 | 1970/01/01 00:00:00 bob> update |
|
133 | 1970/01/01 00:00:00 bob> update | |
134 | 1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) |
|
134 | 1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) | |
135 | 1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob) |
|
135 | 1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob) | |
136 |
1970/01/01 00:00:00 bob> update exited |
|
136 | 1970/01/01 00:00:00 bob> update exited 0 after * seconds (glob) | |
137 |
|
137 | |||
138 | log rotation |
|
138 | log rotation | |
139 |
|
139 |
@@ -167,7 +167,6 b' test delay time estimates' | |||||
167 |
|
167 | |||
168 | $ hg -y loop 8 |
|
168 | $ hg -y loop 8 | |
169 | \r (no-eol) (esc) |
|
169 | \r (no-eol) (esc) | |
170 | loop [====> ] 1/8 1m18s\r (no-eol) (esc) |
|
|||
171 | loop [=========> ] 2/8 1m07s\r (no-eol) (esc) |
|
170 | loop [=========> ] 2/8 1m07s\r (no-eol) (esc) | |
172 | loop [===============> ] 3/8 56s\r (no-eol) (esc) |
|
171 | loop [===============> ] 3/8 56s\r (no-eol) (esc) | |
173 | loop [=====================> ] 4/8 45s\r (no-eol) (esc) |
|
172 | loop [=====================> ] 4/8 45s\r (no-eol) (esc) | |
@@ -204,7 +203,6 b' test delay time estimates' | |||||
204 | Time estimates should not fail when there's no end point: |
|
203 | Time estimates should not fail when there's no end point: | |
205 | $ hg -y loop -- -4 |
|
204 | $ hg -y loop -- -4 | |
206 | \r (no-eol) (esc) |
|
205 | \r (no-eol) (esc) | |
207 |
loop [ <=> ] |
|
206 | loop [ <=> ] 2\r (no-eol) (esc) | |
208 |
loop [ <=> ] |
|
207 | loop [ <=> ] 3\r (no-eol) (esc) | |
209 | loop [ <=> ] 3\r (no-eol) (esc) |
|
|||
210 | \r (no-eol) (esc) |
|
208 | \r (no-eol) (esc) |
General Comments 0
You need to be logged in to leave comments.
Login now