88 try: |
88 try: |
89 from mercurial.demandload import * # stable |
89 from mercurial.demandload import * # stable |
90 from mercurial.i18n import gettext as _ |
90 from mercurial.i18n import gettext as _ |
91 demandload(globals(), 'mercurial:commands,fancyopts,templater,util') |
91 demandload(globals(), 'mercurial:commands,fancyopts,templater,util') |
92 demandload(globals(), 'mercurial:cmdutil,context,filelog,revlog') |
92 demandload(globals(), 'mercurial:cmdutil,context,filelog,revlog') |
93 demandload(globals(), 're sys time') |
93 demandload(globals(), 'os re sys time') |
94 except ImportError: # demandimport |
94 except ImportError: # demandimport |
95 from mercurial.i18n import _ |
95 from mercurial.i18n import _ |
96 from mercurial import commands, fancyopts, templater, util |
96 from mercurial import commands, fancyopts, templater, util |
97 from mercurial import cmdutil, context, filelog, revlog |
97 from mercurial import cmdutil, context, filelog, revlog |
98 import re, sys, time |
98 import os, re, sys, time |
99 |
99 |
100 deftemplates = { |
100 deftemplates = { |
101 'Revision': '{node|short}', |
101 'Revision': '{node|short}', |
102 'Author': '{author|user}', |
102 'Author': '{author|user}', |
103 'Date': '{date|utcdate}', |
103 'Date': '{date|utcdate}', |
276 if node is None: |
276 if node is None: |
277 return node |
277 return node |
278 |
278 |
279 candidates = self.changelog.read(node)[3] |
279 candidates = self.changelog.read(node)[3] |
280 candidates = [f for f in candidates if f not in removed |
280 candidates = [f for f in candidates if f not in removed |
281 and not self._link(f) and self.kwfmatcher(f)] |
281 and not os.path.islink(self.wjoin(f)) |
|
282 and self.kwfmatcher(f)] |
282 if not candidates: |
283 if not candidates: |
283 return node |
284 return node |
284 |
285 |
285 kwt = kwtemplater(self.ui, self) |
286 kwt = kwtemplater(self.ui, self) |
286 kwt.overwrite(candidates, node) |
287 kwt.overwrite(candidates, node) |