Show More
@@ -229,8 +229,7 b' class mercurial_source(converter_source)' | |||||
229 | raise IOError(err) |
|
229 | raise IOError(err) | |
230 |
|
230 | |||
231 | def getmode(self, name, rev): |
|
231 | def getmode(self, name, rev): | |
232 |
|
|
232 | return self.changectx(rev).manifest().flags(name) | |
233 | return (m.execf(name) and 'x' or '') + (m.linkf(name) and 'l' or '') |
|
|||
234 |
|
233 | |||
235 | def getchanges(self, rev): |
|
234 | def getchanges(self, rev): | |
236 | ctx = self.changectx(rev) |
|
235 | ctx = self.changectx(rev) |
@@ -163,11 +163,11 b' class kwtemplater(object):' | |||||
163 | return self.substitute(data, path, changenode, self.re_kw.sub) |
|
163 | return self.substitute(data, path, changenode, self.re_kw.sub) | |
164 | return data |
|
164 | return data | |
165 |
|
165 | |||
166 |
def iskwfile(self, path, |
|
166 | def iskwfile(self, path, flagfunc): | |
167 | '''Returns true if path matches [keyword] pattern |
|
167 | '''Returns true if path matches [keyword] pattern | |
168 | and is not a symbolic link. |
|
168 | and is not a symbolic link. | |
169 | Caveat: localrepository._link fails on Windows.''' |
|
169 | Caveat: localrepository._link fails on Windows.''' | |
170 |
return self.matcher(path) and not |
|
170 | return self.matcher(path) and not 'l' in flagfunc(path) | |
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.''' | |
@@ -178,9 +178,8 b' class kwtemplater(object):' | |||||
178 | notify = self.ui.debug |
|
178 | notify = self.ui.debug | |
179 | else: # kwexpand/kwshrink |
|
179 | else: # kwexpand/kwshrink | |
180 | ctx = self.repo['.'] |
|
180 | ctx = self.repo['.'] | |
181 | mf = ctx.manifest() |
|
|||
182 | notify = self.ui.note |
|
181 | notify = self.ui.note | |
183 |
candidates = [f for f in files if self.iskwfile(f, |
|
182 | candidates = [f for f in files if self.iskwfile(f, ctx.flags)] | |
184 | if candidates: |
|
183 | if candidates: | |
185 | self.restrict = True # do not expand when reading |
|
184 | self.restrict = True # do not expand when reading | |
186 | candidates.sort() |
|
185 | candidates.sort() | |
@@ -387,8 +386,7 b' def files(ui, repo, *pats, **opts):' | |||||
387 | files += unknown |
|
386 | files += unknown | |
388 | files.sort() |
|
387 | files.sort() | |
389 | wctx = repo[None] |
|
388 | wctx = repo[None] | |
390 | islink = lambda p: 'l' in wctx.flags(p) |
|
389 | kwfiles = [f for f in files if kwt.iskwfile(f, wctx.flags)] | |
391 | kwfiles = [f for f in files if kwt.iskwfile(f, islink)] |
|
|||
392 | cwd = pats and repo.getcwd() or '' |
|
390 | cwd = pats and repo.getcwd() or '' | |
393 | kwfstats = not opts.get('ignore') and (('K', kwfiles),) or () |
|
391 | kwfstats = not opts.get('ignore') and (('K', kwfiles),) or () | |
394 | if opts.get('all') or opts.get('ignore'): |
|
392 | if opts.get('all') or opts.get('ignore'): |
@@ -208,18 +208,17 b' def archive(repo, dest, node, kind, deco' | |||||
208 | data = repo.wwritedata(name, data) |
|
208 | data = repo.wwritedata(name, data) | |
209 | archiver.addfile(name, mode, islink, data) |
|
209 | archiver.addfile(name, mode, islink, data) | |
210 |
|
210 | |||
211 | ctx = repo[node] |
|
|||
212 | if kind not in archivers: |
|
211 | if kind not in archivers: | |
213 | raise util.Abort(_("unknown archive type '%s'" % kind)) |
|
212 | raise util.Abort(_("unknown archive type '%s'" % kind)) | |
|
213 | ||||
|
214 | ctx = repo[node] | |||
214 | archiver = archivers[kind](dest, prefix, mtime or ctx.date()[0]) |
|
215 | archiver = archivers[kind](dest, prefix, mtime or ctx.date()[0]) | |
215 | m = ctx.manifest() |
|
216 | ||
216 | items = m.items() |
|
|||
217 | items.sort() |
|
|||
218 | if repo.ui.configbool("ui", "archivemeta", True): |
|
217 | if repo.ui.configbool("ui", "archivemeta", True): | |
219 | write('.hg_archival.txt', 0644, False, |
|
218 | write('.hg_archival.txt', 0644, False, | |
220 | lambda: 'repo: %s\nnode: %s\n' % ( |
|
219 | lambda: 'repo: %s\nnode: %s\n' % ( | |
221 | hex(repo.changelog.node(0)), hex(node))) |
|
220 | hex(repo.changelog.node(0)), hex(node))) | |
222 | for filename, filenode in items: |
|
221 | for f in ctx: | |
223 | write(filename, m.execf(filename) and 0755 or 0644, m.linkf(filename), |
|
222 | ff = ctx.flags(f) | |
224 | lambda: repo.file(filename).read(filenode)) |
|
223 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data) | |
225 | archiver.done() |
|
224 | archiver.done() |
@@ -1866,17 +1866,13 b' def manifest(ui, repo, node=None, rev=No' | |||||
1866 | if not node: |
|
1866 | if not node: | |
1867 | node = rev |
|
1867 | node = rev | |
1868 |
|
1868 | |||
1869 | m = repo[node].manifest() |
|
1869 | decor = {'l':'644 @ ', 'x':'755 * ', '':'644 '} | |
1870 | files = m.keys() |
|
1870 | ctx = repo[node] | |
1871 | files.sort() |
|
1871 | for f in ctx: | |
1872 |
|
||||
1873 | for f in files: |
|
|||
1874 | if ui.debugflag: |
|
1872 | if ui.debugflag: | |
1875 | ui.write("%40s " % hex(m[f])) |
|
1873 | ui.write("%40s " % hex(ctx.manifest()[f])) | |
1876 | if ui.verbose: |
|
1874 | if ui.verbose: | |
1877 | type = m.execf(f) and "*" or m.linkf(f) and "@" or " " |
|
1875 | ui.write(decor[ctx.flags(f)]) | |
1878 | perm = m.execf(f) and "755" or "644" |
|
|||
1879 | ui.write("%3s %1s " % (perm, type)) |
|
|||
1880 | ui.write("%s\n" % f) |
|
1876 | ui.write("%s\n" % f) | |
1881 |
|
1877 | |||
1882 | def merge(ui, repo, node=None, force=None, rev=None): |
|
1878 | def merge(ui, repo, node=None, force=None, rev=None): |
@@ -384,7 +384,7 b' class dirstate(object):' | |||||
384 | def rebuild(self, parent, files): |
|
384 | def rebuild(self, parent, files): | |
385 | self.clear() |
|
385 | self.clear() | |
386 | for f in files: |
|
386 | for f in files: | |
387 |
if files. |
|
387 | if 'x' in files.flag(f): | |
388 | self._map[f] = ('n', 0777, -1, 0, 0) |
|
388 | self._map[f] = ('n', 0777, -1, 0, 0) | |
389 | else: |
|
389 | else: | |
390 | self._map[f] = ('n', 0666, -1, 0, 0) |
|
390 | self._map[f] = ('n', 0666, -1, 0, 0) |
@@ -18,12 +18,6 b' class manifestdict(dict):' | |||||
18 | self._flags = flags |
|
18 | self._flags = flags | |
19 | def flags(self, f): |
|
19 | def flags(self, f): | |
20 | return self._flags.get(f, "") |
|
20 | return self._flags.get(f, "") | |
21 | def execf(self, f): |
|
|||
22 | "test for executable in manifest flags" |
|
|||
23 | return "x" in self.flags(f) |
|
|||
24 | def linkf(self, f): |
|
|||
25 | "test for symlink in manifest flags" |
|
|||
26 | return "l" in self.flags(f) |
|
|||
27 | def set(self, f, flags): |
|
21 | def set(self, f, flags): | |
28 | self._flags[f] = flags |
|
22 | self._flags[f] = flags | |
29 | def copy(self): |
|
23 | def copy(self): |
General Comments 0
You need to be logged in to leave comments.
Login now