@@ -40,30 +40,32 class Repository::Darcs < Repository | |||||
40 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) |
|
40 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) | |
41 | scm.entry(path, patch.nil? ? nil : patch.scmid) |
|
41 | scm.entry(path, patch.nil? ? nil : patch.scmid) | |
42 | end |
|
42 | end | |
43 |
|
43 | |||
44 | def entries(path=nil, identifier=nil) |
|
44 | def entries(path=nil, identifier=nil) | |
45 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) |
|
45 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) | |
46 | entries = scm.entries(path, patch.nil? ? nil : patch.scmid) |
|
46 | entries = scm.entries(path, patch.nil? ? nil : patch.scmid) | |
47 | if entries |
|
47 | if entries | |
48 | entries.each do |entry| |
|
48 | entries.each do |entry| | |
49 | # Search the DB for the entry's last change |
|
49 | # Search the DB for the entry's last change | |
50 |
|
|
50 | if entry.lastrev && !entry.lastrev.scmid.blank? | |
|
51 | changeset = changesets.find_by_scmid(entry.lastrev.scmid) | |||
|
52 | end | |||
51 | if changeset |
|
53 | if changeset | |
52 | entry.lastrev.identifier = changeset.revision |
|
54 | entry.lastrev.identifier = changeset.revision | |
53 | entry.lastrev.name = changeset.revision |
|
55 | entry.lastrev.name = changeset.revision | |
54 | entry.lastrev.time = changeset.committed_on |
|
56 | entry.lastrev.time = changeset.committed_on | |
55 | entry.lastrev.author = changeset.committer |
|
57 | entry.lastrev.author = changeset.committer | |
56 | end |
|
58 | end | |
57 | end |
|
59 | end | |
58 | end |
|
60 | end | |
59 | entries |
|
61 | entries | |
60 | end |
|
62 | end | |
61 |
|
63 | |||
62 | def cat(path, identifier=nil) |
|
64 | def cat(path, identifier=nil) | |
63 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s) |
|
65 | patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s) | |
64 | scm.cat(path, patch.nil? ? nil : patch.scmid) |
|
66 | scm.cat(path, patch.nil? ? nil : patch.scmid) | |
65 | end |
|
67 | end | |
66 |
|
68 | |||
67 | def diff(path, rev, rev_to) |
|
69 | def diff(path, rev, rev_to) | |
68 | patch_from = changesets.find_by_revision(rev) |
|
70 | patch_from = changesets.find_by_revision(rev) | |
69 | return nil if patch_from.nil? |
|
71 | return nil if patch_from.nil? | |
@@ -73,7 +75,7 class Repository::Darcs < Repository | |||||
73 | end |
|
75 | end | |
74 | patch_from ? scm.diff(path, patch_from.scmid, patch_to ? patch_to.scmid : nil) : nil |
|
76 | patch_from ? scm.diff(path, patch_from.scmid, patch_to ? patch_to.scmid : nil) : nil | |
75 | end |
|
77 | end | |
76 |
|
78 | |||
77 | def fetch_changesets |
|
79 | def fetch_changesets | |
78 | scm_info = scm.info |
|
80 | scm_info = scm.info | |
79 | if scm_info |
|
81 | if scm_info |
General Comments 0
You need to be logged in to leave comments.
Login now