Show More
@@ -171,12 +171,14 b' class kwtemplater(object):' | |||||
171 |
|
171 | |||
172 | def overwrite(self, node, expand, files): |
|
172 | def overwrite(self, node, expand, files): | |
173 | '''Overwrites selected files expanding/shrinking keywords.''' |
|
173 | '''Overwrites selected files expanding/shrinking keywords.''' | |
174 | ctx = self.repo.changectx(node) |
|
|||
175 | mf = ctx.manifest() |
|
|||
176 | if node is not None: # commit |
|
174 | if node is not None: # commit | |
|
175 | ctx = self.repo.changectx(node) | |||
|
176 | mf = ctx.manifest() | |||
177 | files = [f for f in ctx.files() if f in mf] |
|
177 | files = [f for f in ctx.files() if f in mf] | |
178 | notify = self.ui.debug |
|
178 | notify = self.ui.debug | |
179 | else: # kwexpand/kwshrink |
|
179 | else: # kwexpand/kwshrink | |
|
180 | ctx = self.repo.changectx('.') | |||
|
181 | mf = ctx.manifest() | |||
180 | notify = self.ui.note |
|
182 | notify = self.ui.note | |
181 | candidates = [f for f in files if self.iskwfile(f, mf.linkf)] |
|
183 | candidates = [f for f in files if self.iskwfile(f, mf.linkf)] | |
182 | if candidates: |
|
184 | if candidates: | |
@@ -511,7 +513,7 b' def reposetup(ui, repo):' | |||||
511 | comparing against working dir.''' |
|
513 | comparing against working dir.''' | |
512 | if node2 is not None: |
|
514 | if node2 is not None: | |
513 | kwt.matcher = util.never |
|
515 | kwt.matcher = util.never | |
514 | elif node1 is not None and node1 != repo.changectx().node(): |
|
516 | elif node1 is not None and node1 != repo.changectx('.').node(): | |
515 | kwt.restrict = True |
|
517 | kwt.restrict = True | |
516 | patch_diff(repo, node1, node2, match, fp, changes, opts) |
|
518 | patch_diff(repo, node1, node2, match, fp, changes, opts) | |
517 |
|
519 |
@@ -245,7 +245,7 b' def findrenames(repo, added=None, remove' | |||||
245 | '''find renamed files -- yields (before, after, score) tuples''' |
|
245 | '''find renamed files -- yields (before, after, score) tuples''' | |
246 | if added is None or removed is None: |
|
246 | if added is None or removed is None: | |
247 | added, removed = repo.status()[1:3] |
|
247 | added, removed = repo.status()[1:3] | |
248 | ctx = repo.changectx() |
|
248 | ctx = repo.changectx('.') | |
249 | for a in added: |
|
249 | for a in added: | |
250 | aa = repo.wread(a) |
|
250 | aa = repo.wread(a) | |
251 | bestname, bestscore = None, threshold |
|
251 | bestname, bestscore = None, threshold | |
@@ -992,7 +992,7 b' def walkchangerevs(ui, repo, pats, chang' | |||||
992 | return [], m |
|
992 | return [], m | |
993 |
|
993 | |||
994 | if follow: |
|
994 | if follow: | |
995 | defrange = '%s:0' % repo.changectx().rev() |
|
995 | defrange = '%s:0' % repo.changectx('.').rev() | |
996 | else: |
|
996 | else: | |
997 | defrange = '-1:0' |
|
997 | defrange = '-1:0' | |
998 | revs = revrange(repo, opts['rev'] or [defrange]) |
|
998 | revs = revrange(repo, opts['rev'] or [defrange]) |
@@ -189,7 +189,7 b' def backout(ui, repo, node=None, rev=Non' | |||||
189 | hand. The result of this merge is not committed, as for a normal |
|
189 | hand. The result of this merge is not committed, as for a normal | |
190 | merge. |
|
190 | merge. | |
191 |
|
191 | |||
192 | See 'hg help dates' for a list of formats valid for -d/--date. |
|
192 | See \'hg help dates\' for a list of formats valid for -d/--date. | |
193 | ''' |
|
193 | ''' | |
194 | if rev and node: |
|
194 | if rev and node: | |
195 | raise util.Abort(_("please specify just one revision")) |
|
195 | raise util.Abort(_("please specify just one revision")) | |
@@ -2670,11 +2670,12 b' def status(ui, repo, *pats, **opts):' | |||||
2670 | if (opts['all'] or opts['copies']) and not opts['no_status']: |
|
2670 | if (opts['all'] or opts['copies']) and not opts['no_status']: | |
2671 | ctxn = repo.changectx(nullid) |
|
2671 | ctxn = repo.changectx(nullid) | |
2672 | ctx1 = repo.changectx(node1) |
|
2672 | ctx1 = repo.changectx(node1) | |
2673 | ctx2 = repo.changectx(node2) |
|
|||
2674 | added = stat[1] |
|
2673 | added = stat[1] | |
2675 | if node2 is None: |
|
2674 | if node2 is None: | |
2676 | added = stat[0] + stat[1] # merged? |
|
2675 | added = stat[0] + stat[1] # merged? | |
2677 | ctx2 = repo.workingctx() |
|
2676 | ctx2 = repo.workingctx() | |
|
2677 | else: | |||
|
2678 | ctx2 = repo.changectx(node2) | |||
2678 | for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items(): |
|
2679 | for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items(): | |
2679 | if k in added: |
|
2680 | if k in added: | |
2680 | copy[k] = v |
|
2681 | copy[k] = v | |
@@ -2713,7 +2714,7 b' def tag(ui, repo, name1, *names, **opts)' | |||||
2713 | See 'hg help dates' for a list of formats valid for -d/--date. |
|
2714 | See 'hg help dates' for a list of formats valid for -d/--date. | |
2714 | """ |
|
2715 | """ | |
2715 |
|
2716 | |||
2716 |
rev_ = |
|
2717 | rev_ = "." | |
2717 | names = (name1,) + names |
|
2718 | names = (name1,) + names | |
2718 | if len(names) != len(dict.fromkeys(names)): |
|
2719 | if len(names) != len(dict.fromkeys(names)): | |
2719 | raise util.Abort(_('tag names must be unique')) |
|
2720 | raise util.Abort(_('tag names must be unique')) |
@@ -483,7 +483,9 b' class localrepository(repo.repository):' | |||||
483 | f = f[1:] |
|
483 | f = f[1:] | |
484 | return filelog.filelog(self.sopener, f) |
|
484 | return filelog.filelog(self.sopener, f) | |
485 |
|
485 | |||
486 |
def changectx(self, changeid |
|
486 | def changectx(self, changeid): | |
|
487 | if changeid == None: | |||
|
488 | raise "nope!" | |||
487 | return context.changectx(self, changeid) |
|
489 | return context.changectx(self, changeid) | |
488 |
|
490 | |||
489 | def workingctx(self): |
|
491 | def workingctx(self): | |
@@ -1018,7 +1020,7 b' class localrepository(repo.repository):' | |||||
1018 | if lookup: |
|
1020 | if lookup: | |
1019 | fixup = [] |
|
1021 | fixup = [] | |
1020 | # do a full compare of any files that might have changed |
|
1022 | # do a full compare of any files that might have changed | |
1021 | ctx = self.changectx() |
|
1023 | ctx = self.changectx('') | |
1022 | mexec = lambda f: 'x' in ctx.fileflags(f) |
|
1024 | mexec = lambda f: 'x' in ctx.fileflags(f) | |
1023 | mlink = lambda f: 'l' in ctx.fileflags(f) |
|
1025 | mlink = lambda f: 'l' in ctx.fileflags(f) | |
1024 | is_exec = util.execfunc(self.root, mexec) |
|
1026 | is_exec = util.execfunc(self.root, mexec) |
General Comments 0
You need to be logged in to leave comments.
Login now