Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 11303:a1aad8333864
move working dir/dirstate methods from localrepo to workingctx
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 07 Jun 2010 20:03:32 +0200 |
parents | e1dde7363601 |
children | fcd06ecd4cb7 |
comparison
equal
deleted
inserted
replaced
11302:e1dde7363601 | 11303:a1aad8333864 |
---|---|
54 if exact or f not in repo.dirstate: | 54 if exact or f not in repo.dirstate: |
55 names.append(f) | 55 names.append(f) |
56 if ui.verbose or not exact: | 56 if ui.verbose or not exact: |
57 ui.status(_('adding %s\n') % m.rel(f)) | 57 ui.status(_('adding %s\n') % m.rel(f)) |
58 if not opts.get('dry_run'): | 58 if not opts.get('dry_run'): |
59 bad += [f for f in repo.add(names) if f in m.files()] | 59 bad += [f for f in repo[None].add(names) if f in m.files()] |
60 return bad and 1 or 0 | 60 return bad and 1 or 0 |
61 | 61 |
62 def addremove(ui, repo, *pats, **opts): | 62 def addremove(ui, repo, *pats, **opts): |
63 """add all new files, delete all missing files | 63 """add all new files, delete all missing files |
64 | 64 |
1312 | 1312 |
1313 for f in forget: | 1313 for f in forget: |
1314 if ui.verbose or not m.exact(f): | 1314 if ui.verbose or not m.exact(f): |
1315 ui.status(_('removing %s\n') % m.rel(f)) | 1315 ui.status(_('removing %s\n') % m.rel(f)) |
1316 | 1316 |
1317 repo.remove(forget, unlink=False) | 1317 repo[None].remove(forget, unlink=False) |
1318 return errs | 1318 return errs |
1319 | 1319 |
1320 def grep(ui, repo, pattern, *pats, **opts): | 1320 def grep(ui, repo, pattern, *pats, **opts): |
1321 """search for a pattern in specified files and revisions | 1321 """search for a pattern in specified files and revisions |
1322 | 1322 |
2667 | 2667 |
2668 for f in sorted(remove + forget): | 2668 for f in sorted(remove + forget): |
2669 if ui.verbose or not m.exact(f): | 2669 if ui.verbose or not m.exact(f): |
2670 ui.status(_('removing %s\n') % m.rel(f)) | 2670 ui.status(_('removing %s\n') % m.rel(f)) |
2671 | 2671 |
2672 repo.forget(forget) | 2672 repo[None].forget(forget) |
2673 repo.remove(remove, unlink=not after) | 2673 repo[None].remove(remove, unlink=not after) |
2674 return ret | 2674 return ret |
2675 | 2675 |
2676 def rename(ui, repo, *pats, **opts): | 2676 def rename(ui, repo, *pats, **opts): |
2677 """rename files; equivalent of copy + remove | 2677 """rename files; equivalent of copy + remove |
2678 | 2678 |