Skip to content

Commit

Permalink
[feature] opages: better revisions history + log into console the map
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ye committed Jul 11, 2011
1 parent 2bb2df3 commit 3a7b951
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OPAges/src/page.opa
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ Page = {{
_ -> IntMap.add(parent, (author, date, -1, [i]), acc) _ -> IntMap.add(parent, (author, date, -1, [i]), acc)
map = List.foldi(make_map, hist, IntMap.empty) map = List.foldi(make_map, hist, IntMap.empty)
//do IntMap.iter(k, v -> jlog("{k} -> {v}"), map) do IntMap.iter(k, v -> Log.info("map", "{k} -> {v}"), map)
/* Build one revision of the file for the select input */ /* Build one revision of the file for the select input */
build_rev(key, (author, date, parent, sons), (acc, pad)) = build_rev(key, (author, date, parent, sons), (acc, pad)) =
Expand All @@ -808,8 +808,8 @@ Page = {{
{some=(author, date, parent, sons)} -> {some=(author, date, parent, sons)} ->
//do jlog("rev {rev}") //do jlog("rev {rev}")
acc = if rev < 0 then acc else build_rev(rev, (author, date, parent, sons), (acc, pad)) acc = if rev < 0 then acc else build_rev(rev, (author, date, parent, sons), (acc, pad))
pad = if p_sons_len > 1 then pad+1 else pad
len = List.length(sons) len = List.length(sons)
pad = if p_sons_len > 1 || len > 1 then pad+1 else pad
List.fold( List.fold(
rev_son, acc -> aux(map, rev_son, (acc, pad, len)) rev_son, acc -> aux(map, rev_son, (acc, pad, len))
, sons, acc) , sons, acc)
Expand Down

0 comments on commit 3a7b951

Please sign in to comment.