Mercurial > hg
comparison hgext/mq.py @ 9733:f16ec85f125c
mq: do not call ui.username unless it is necessary
After changeset c63c336ee2f7, ui.username will abort by default if no
username is set. It is therefore wrong to call ui.username when a
username was provided on the command line.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sat, 07 Nov 2009 00:13:05 +0100 |
parents | 3f522d2fa633 |
children | 87c92b260710 |
comparison
equal
deleted
inserted
replaced
9732:092bcf431562 | 9733:f16ec85f125c |
---|---|
1912 return 1 | 1912 return 1 |
1913 return q.qseries(repo, start=l-2, length=1, status='A', | 1913 return q.qseries(repo, start=l-2, length=1, status='A', |
1914 summary=opts.get('summary')) | 1914 summary=opts.get('summary')) |
1915 | 1915 |
1916 def setupheaderopts(ui, opts): | 1916 def setupheaderopts(ui, opts): |
1917 def do(opt, val): | 1917 if not opts.get('user') and opts.get('currentuser'): |
1918 if not opts[opt] and opts['current' + opt]: | 1918 opts['user'] = ui.username() |
1919 opts[opt] = val | 1919 if not opts.get('date') and opts.get('currentdate'): |
1920 do('user', ui.username()) | 1920 opts['date'] = "%d %d" % util.makedate() |
1921 do('date', "%d %d" % util.makedate()) | |
1922 | 1921 |
1923 def new(ui, repo, patch, *args, **opts): | 1922 def new(ui, repo, patch, *args, **opts): |
1924 """create a new patch | 1923 """create a new patch |
1925 | 1924 |
1926 qnew creates a new patch on top of the currently-applied patch (if | 1925 qnew creates a new patch on top of the currently-applied patch (if |