163 11:00:13Z". |
163 11:00:13Z". |
164 ''' |
164 ''' |
165 return util.datestr((util.parsedate(text)[0], 0), '%Y-%m-%d %H:%M:%SZ') |
165 return util.datestr((util.parsedate(text)[0], 0), '%Y-%m-%d %H:%M:%SZ') |
166 |
166 |
167 # make keyword tools accessible |
167 # make keyword tools accessible |
168 kwtools = {'templater': None, 'hgcmd': ''} |
168 kwtools = {'hgcmd': ''} |
169 |
169 |
170 def _defaultkwmaps(ui): |
170 def _defaultkwmaps(ui): |
171 '''Returns default keywordmaps according to keywordset configuration.''' |
171 '''Returns default keywordmaps according to keywordset configuration.''' |
172 templates = { |
172 templates = { |
173 'Revision': '{node|short}', |
173 'Revision': '{node|short}', |
383 def _kwfwrite(ui, repo, expand, *pats, **opts): |
383 def _kwfwrite(ui, repo, expand, *pats, **opts): |
384 '''Selects files and passes them to kwtemplater.overwrite.''' |
384 '''Selects files and passes them to kwtemplater.overwrite.''' |
385 wctx = repo[None] |
385 wctx = repo[None] |
386 if len(wctx.parents()) > 1: |
386 if len(wctx.parents()) > 1: |
387 raise error.Abort(_('outstanding uncommitted merge')) |
387 raise error.Abort(_('outstanding uncommitted merge')) |
388 kwt = kwtools['templater'] |
388 kwt = getattr(repo, '_keywordkwt', None) |
389 with repo.wlock(): |
389 with repo.wlock(): |
390 status = _status(ui, repo, wctx, kwt, *pats, **opts) |
390 status = _status(ui, repo, wctx, kwt, *pats, **opts) |
391 if status.modified or status.added or status.removed or status.deleted: |
391 if status.modified or status.added or status.removed or status.deleted: |
392 raise error.Abort(_('outstanding uncommitted changes')) |
392 raise error.Abort(_('outstanding uncommitted changes')) |
393 kwt.overwrite(wctx, status.clean, True, expand) |
393 kwt.overwrite(wctx, status.clean, True, expand) |
527 K = keyword expansion candidate |
527 K = keyword expansion candidate |
528 k = keyword expansion candidate (not tracked) |
528 k = keyword expansion candidate (not tracked) |
529 I = ignored |
529 I = ignored |
530 i = ignored (not tracked) |
530 i = ignored (not tracked) |
531 ''' |
531 ''' |
532 kwt = kwtools['templater'] |
532 kwt = getattr(repo, '_keywordkwt', None) |
533 wctx = repo[None] |
533 wctx = repo[None] |
534 status = _status(ui, repo, wctx, kwt, *pats, **opts) |
534 status = _status(ui, repo, wctx, kwt, *pats, **opts) |
535 if pats: |
535 if pats: |
536 cwd = repo.getcwd() |
536 cwd = repo.getcwd() |
537 else: |
537 else: |