-awk <$rlogout '
- /^Working file:/ { filename = $3 }
- /^date: /, /^(-----------*|===========*)$/ {
- if ($0 ~ /^branches: /) { next }
- if ($0 ~ /^date: [0-9][ \/0-9:]*;/) {
- time = substr($3, 1, length($3)-1)
+$AWK <$rlogout '
+ BEGIN { repository = "'"$repository"'" }
+ /^RCS file:/ {
+ if (repository != "") {
+ filename = $3
+ if (substr(filename, 1, length(repository) + 1) == repository "/") {
+ filename = substr(filename, length(repository) + 2)
+ }
+ if (filename ~ /,v$/) {
+ filename = substr(filename, 1, length(filename) - 2)
+ }
+ if (filename ~ /(^|\/)Attic\/[^\/]*$/) {
+ i = length(filename)
+ while (substr(filename, i, 1) != "/") i--
+ filename = substr(filename, 1, i - 6) substr(filename, i + 1)
+ }
+ }
+ rev = "?"
+ }
+ /^Working file:/ { if (repository == "") filename = $3 }
+ /'"$rlog_revision_pattern"'/, /^(-----------*|===========*)$/ {
+ line = $0
+ if (line ~ /'"$rlog_revision_pattern"'/) {
+ rev = $2
+ next
+ }
+ if (line ~ /^date: [0-9][- +\/0-9:]*;/) {
+ date = $2
+ if (date ~ /\//) {
+ # This is a traditional RCS format date YYYY/MM/DD.
+ # Replace "/"s with "-"s to get ISO format.
+ newdate = ""
+ while ((i = index(date, "/")) != 0) {
+ newdate = newdate substr(date, 1, i-1) "-"
+ date = substr(date, i+1)
+ }
+ date = newdate date
+ }
+ time = substr($3, 1, length($3) - 1)