Show More
@@ -128,13 +128,17 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
128 | if not slowpath: |
|
128 | if not slowpath: | |
129 | # Only files, no patterns. Check the history of each file. |
|
129 | # Only files, no patterns. Check the history of each file. | |
130 | def filerevgen(filelog): |
|
130 | def filerevgen(filelog): | |
|
131 | cl_count = repo.changelog.count() | |||
131 | for i, window in increasing_windows(filelog.count()-1, -1): |
|
132 | for i, window in increasing_windows(filelog.count()-1, -1): | |
132 | revs = [] |
|
133 | revs = [] | |
133 | for j in xrange(i - window, i + 1): |
|
134 | for j in xrange(i - window, i + 1): | |
134 | revs.append(filelog.linkrev(filelog.node(j))) |
|
135 | revs.append(filelog.linkrev(filelog.node(j))) | |
135 | revs.reverse() |
|
136 | revs.reverse() | |
136 | for rev in revs: |
|
137 | for rev in revs: | |
137 | yield rev |
|
138 | # only yield rev for which we have the changelog, it can | |
|
139 | # happen while doing "hg log" during a pull or commit | |||
|
140 | if rev < cl_count: | |||
|
141 | yield rev | |||
138 |
|
142 | |||
139 | minrev, maxrev = min(revs), max(revs) |
|
143 | minrev, maxrev = min(revs), max(revs) | |
140 | for file_ in files: |
|
144 | for file_ in files: | |
@@ -3514,7 +3518,9 b' def dispatch(args):' | |||||
3514 | return inst.code |
|
3518 | return inst.code | |
3515 | except: |
|
3519 | except: | |
3516 | u.warn(_("** unknown exception encountered, details follow\n")) |
|
3520 | u.warn(_("** unknown exception encountered, details follow\n")) | |
3517 |
u.warn(_("** report bug details to |
|
3521 | u.warn(_("** report bug details to " | |
|
3522 | "http://www.selenic.com/mercurial/bts\n")) | |||
|
3523 | u.warn(_("** or mercurial@selenic.com\n")) | |||
3518 | u.warn(_("** Mercurial Distributed SCM (version %s)\n") |
|
3524 | u.warn(_("** Mercurial Distributed SCM (version %s)\n") | |
3519 | % version.get_version()) |
|
3525 | % version.get_version()) | |
3520 | raise |
|
3526 | raise |
@@ -39,21 +39,23 b' class changectx(object):' | |||||
39 |
|
39 | |||
40 | def parents(self): |
|
40 | def parents(self): | |
41 | """return contexts for each parent changeset""" |
|
41 | """return contexts for each parent changeset""" | |
42 | p = self.repo.changelog.parents(self._node) |
|
42 | p = self._repo.changelog.parents(self._node) | |
43 | return [ changectx(self._repo, x) for x in p ] |
|
43 | return [ changectx(self._repo, x) for x in p ] | |
44 |
|
44 | |||
45 | def children(self): |
|
45 | def children(self): | |
46 | """return contexts for each child changeset""" |
|
46 | """return contexts for each child changeset""" | |
47 | c = self.repo.changelog.children(self._node) |
|
47 | c = self._repo.changelog.children(self._node) | |
48 | return [ changectx(self._repo, x) for x in c ] |
|
48 | return [ changectx(self._repo, x) for x in c ] | |
49 |
|
49 | |||
50 | def filenode(self, path): |
|
50 | def filenode(self, path): | |
51 | node, flag = self._repo.manifest.find(self.changeset()[0], path) |
|
51 | node, flag = self._repo.manifest.find(self.changeset()[0], path) | |
52 | return node |
|
52 | return node | |
53 |
|
53 | |||
54 | def filectx(self, path): |
|
54 | def filectx(self, path, fileid=None): | |
55 | """get a file context from this changeset""" |
|
55 | """get a file context from this changeset""" | |
56 | return filectx(self._repo, path, fileid=self.filenode(path)) |
|
56 | if fileid is None: | |
|
57 | fileid = self.filenode(path) | |||
|
58 | return filectx(self._repo, path, fileid=fileid) | |||
57 |
|
59 | |||
58 | def filectxs(self): |
|
60 | def filectxs(self): | |
59 | """generate a file context for each file in this changeset's |
|
61 | """generate a file context for each file in this changeset's | |
@@ -77,10 +79,10 b' class filectx(object):' | |||||
77 |
|
79 | |||
78 | if self._id: |
|
80 | if self._id: | |
79 | # if given a changeset id, go ahead and look up the file |
|
81 | # if given a changeset id, go ahead and look up the file | |
80 |
self._changeset = change |
|
82 | self._changeset = self._repo.changelog.read(self._id) | |
81 | node, flag = self._repo.manifest.find(self._changeset[0], path) |
|
83 | node, flag = self._repo.manifest.find(self._changeset[0], path) | |
82 | self._node = node |
|
84 | self._filelog = self._repo.file(self._path) | |
83 |
self._file |
|
85 | self._filenode = node | |
84 | elif self._fileid: |
|
86 | elif self._fileid: | |
85 | # else be lazy |
|
87 | # else be lazy | |
86 | self._filelog = self._repo.file(self._path) |
|
88 | self._filelog = self._repo.file(self._path) |
@@ -209,7 +209,7 b' class ui(object):' | |||||
209 |
|
209 | |||
210 | def expandpath(self, loc, default=None): |
|
210 | def expandpath(self, loc, default=None): | |
211 | """Return repository location relative to cwd or from [paths]""" |
|
211 | """Return repository location relative to cwd or from [paths]""" | |
212 |
if "://" in loc or os.path. |
|
212 | if "://" in loc or os.path.isdir(loc): | |
213 | return loc |
|
213 | return loc | |
214 |
|
214 | |||
215 | path = self.config("paths", loc) |
|
215 | path = self.config("paths", loc) |
General Comments 0
You need to be logged in to leave comments.
Login now