255 |
255 |
256 def _status(ui, repo, kwt, *pats, **opts): |
256 def _status(ui, repo, kwt, *pats, **opts): |
257 '''Bails out if [keyword] configuration is not active. |
257 '''Bails out if [keyword] configuration is not active. |
258 Returns status of working directory.''' |
258 Returns status of working directory.''' |
259 if kwt: |
259 if kwt: |
260 files, match, anypats = cmdutil.matchpats(repo, pats, opts) |
260 matcher = cmdutil.match(repo, pats, opts) |
261 return repo.status(files=files, match=match, list_clean=True) |
261 return repo.status(match=matcher, list_clean=True) |
262 if ui.configitems('keyword'): |
262 if ui.configitems('keyword'): |
263 raise util.Abort(_('[keyword] patterns cannot match')) |
263 raise util.Abort(_('[keyword] patterns cannot match')) |
264 raise util.Abort(_('no [keyword] patterns configured')) |
264 raise util.Abort(_('no [keyword] patterns configured')) |
265 |
265 |
266 def _kwfwrite(ui, repo, expand, *pats, **opts): |
266 def _kwfwrite(ui, repo, expand, *pats, **opts): |
456 def wread(self, filename): |
456 def wread(self, filename): |
457 data = super(kwrepo, self).wread(filename) |
457 data = super(kwrepo, self).wread(filename) |
458 return kwt.wread(filename, data) |
458 return kwt.wread(filename, data) |
459 |
459 |
460 def commit(self, files=None, text='', user=None, date=None, |
460 def commit(self, files=None, text='', user=None, date=None, |
461 match=util.always, force=False, force_editor=False, |
461 match=None, force=False, force_editor=False, |
462 p1=None, p2=None, extra={}, empty_ok=False): |
462 p1=None, p2=None, extra={}, empty_ok=False): |
463 wlock = lock = None |
463 wlock = lock = None |
464 _p1 = _p2 = None |
464 _p1 = _p2 = None |
465 try: |
465 try: |
466 wlock = self.wlock() |
466 wlock = self.wlock() |
503 rejects or conflicts due to expanded keywords in working dir.''' |
503 rejects or conflicts due to expanded keywords in working dir.''' |
504 patchfile_init(self, ui, fname, missing) |
504 patchfile_init(self, ui, fname, missing) |
505 # shrink keywords read from working dir |
505 # shrink keywords read from working dir |
506 self.lines = kwt.shrinklines(self.fname, self.lines) |
506 self.lines = kwt.shrinklines(self.fname, self.lines) |
507 |
507 |
508 def kw_diff(repo, node1=None, node2=None, files=None, match=util.always, |
508 def kw_diff(repo, node1=None, node2=None, match=None, |
509 fp=None, changes=None, opts=None): |
509 fp=None, changes=None, opts=None): |
510 '''Monkeypatch patch.diff to avoid expansion except when |
510 '''Monkeypatch patch.diff to avoid expansion except when |
511 comparing against working dir.''' |
511 comparing against working dir.''' |
512 if node2 is not None: |
512 if node2 is not None: |
513 kwt.matcher = util.never |
513 kwt.matcher = util.never |