Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 21418:d4b8fc753455
tag: use the editor gotten by "getcommiteditor()" instead of "ui.edit()"
This patch also enhances "test-tag.t", because "hg tag" hasn't been
explicitly tested around editor invocation and "--edit" option.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 11 May 2014 00:49:36 +0900 |
parents | 3e717c9376fc |
children | 10f15e34d86c |
comparison
equal
deleted
inserted
replaced
21417:308aaeb956e2 | 21418:d4b8fc753455 |
---|---|
5693 | 5693 |
5694 date = opts.get('date') | 5694 date = opts.get('date') |
5695 if date: | 5695 if date: |
5696 date = util.parsedate(date) | 5696 date = util.parsedate(date) |
5697 | 5697 |
5698 if opts.get('edit'): | 5698 editor = cmdutil.getcommiteditor(**opts) |
5699 def editor(repo, ctx, subs): | |
5700 return ui.edit(ctx.description() + "\n", ctx.user()) | |
5701 else: | |
5702 editor = False | |
5703 | 5699 |
5704 # don't allow tagging the null rev | 5700 # don't allow tagging the null rev |
5705 if (not opts.get('remove') and | 5701 if (not opts.get('remove') and |
5706 scmutil.revsingle(repo, rev_).rev() == nullrev): | 5702 scmutil.revsingle(repo, rev_).rev() == nullrev): |
5707 raise util.Abort(_("cannot tag null revision")) | 5703 raise util.Abort(_("cannot tag null revision")) |