* viewcvs/lib/vclib/svn/__init__.py
(log_helper): Populate the 'action' attribute of the LogEntry. * viewcvs/templates/log.ezt Expect human-readable strings for the action type (instead of the single-character abbreviations). git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@712 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/tags/1.0.0-rc1
parent
594baf20b8
commit
f808704efe
|
@ -134,16 +134,34 @@ def log_helper(svnrepos, rev, path, show_changed_paths):
|
|||
rev_root = fs.revision_root(svnrepos.fs_ptr, rev, svnrepos.pool)
|
||||
other_paths = []
|
||||
changed_paths = fs.paths_changed(rev_root, svnrepos.pool)
|
||||
if not changed_paths.has_key(path):
|
||||
|
||||
# Skip revisions in which this path didn't change.
|
||||
change = changed_paths.get(path)
|
||||
if not change:
|
||||
return None
|
||||
|
||||
# Figure out the type of change that happened on the path.
|
||||
if change.change_kind == fs.path_change_add:
|
||||
action = "added"
|
||||
elif change.change_kind == fs.path_change_delete:
|
||||
action = "deleted"
|
||||
elif change.change_kind == fs.path_change_replace:
|
||||
action = "replaced"
|
||||
else:
|
||||
action = "modified"
|
||||
|
||||
# Now, make ChangedPathEntry objects for all the other paths (if
|
||||
# show_changed_paths is set).
|
||||
del changed_paths[path]
|
||||
if show_changed_paths:
|
||||
for other_path in changed_paths.keys():
|
||||
other_paths.append(ChangedPathEntry(other_path))
|
||||
|
||||
# Finally, assemble our LogEntry.
|
||||
datestr, author, msg = _fs_rev_props(svnrepos.fs_ptr, rev, svnrepos.pool)
|
||||
date = _datestr_to_date(datestr, svnrepos.pool)
|
||||
entry = LogEntry(rev, date, author, msg, path,
|
||||
other_paths, None, None, None)
|
||||
other_paths, action, None, None)
|
||||
if fs.is_file(rev_root, path, svnrepos.pool):
|
||||
entry.size = fs.file_length(rev_root, path, svnrepos.pool)
|
||||
return entry
|
||||
|
|
|
@ -94,10 +94,10 @@
|
|||
|
||||
[is roottype "svn"]
|
||||
[if-any entries.action]
|
||||
[is entries.action "M"]Modified[else]
|
||||
[is entries.action "A"]Added[else]
|
||||
[is entries.action "D"]Deleted[else]
|
||||
[is entries.action "R"]Replaced[end][end][end][end]
|
||||
[is entries.action "modified"]Modified[else]
|
||||
[is entries.action "added"]Added[else]
|
||||
[is entries.action "deleted"]Deleted[else]
|
||||
[is entries.action "replaced"]Replaced[end][end][end][end]
|
||||
[end]
|
||||
[end]
|
||||
|
||||
|
|
Loading…
Reference in New Issue