summaryrefslogtreecommitdiff
path: root/sys/src/cmd/hgfs/info.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-06-27 10:07:19 +0200
committercinap_lenrek <cinap_lenrek@localhost>2011-06-27 10:07:19 +0200
commitd0485d345db63b0ee82301251339e72d6093107d (patch)
tree439e795fccf06ecb48364f8ed51ac416105364bf /sys/src/cmd/hgfs/info.c
parent402ee30714c2cefa9116ff2031672bc6a8cd5c0b (diff)
hgfs: change semantics of log to contain only the file list
Diffstat (limited to 'sys/src/cmd/hgfs/info.c')
-rw-r--r--sys/src/cmd/hgfs/info.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/src/cmd/hgfs/info.c b/sys/src/cmd/hgfs/info.c
index 66246a9e2..de96e751a 100644
--- a/sys/src/cmd/hgfs/info.c
+++ b/sys/src/cmd/hgfs/info.c
@@ -10,6 +10,7 @@ loadrevinfo(Revlog *changelog, int rev)
char buf[BUFSZ], *p, *e;
int fd, line, inmsg, n;
Revinfo *ri;
+ vlong off;
if((fd = revlogopentemp(changelog, rev)) < 0)
return nil;
@@ -23,6 +24,7 @@ loadrevinfo(Revlog *changelog, int rev)
memmove(ri->chash, changelog->map[rev].hash, HASHSZ);
+ off = 0;
line = 0;
inmsg = 0;
p = buf;
@@ -42,19 +44,25 @@ loadrevinfo(Revlog *changelog, int rev)
case 2:
ri->when = strtol(buf, nil, 10);
break;
+ case 3:
+ ri->logoff = off;
default:
if(!inmsg){
- if(*buf == 0)
+ if(*buf == 0){
+ ri->loglen = off - ri->logoff;
inmsg = 1;
+ }
} else {
n = ri->why ? strlen(ri->why) : 0;
ri->why = realloc(ri->why, n + strlen(buf)+1);
strcpy(ri->why + n, buf);
}
}
- p -= e - buf;
+ n = e - buf;
+ p -= n;
if(p > buf)
memmove(buf, e, p - buf);
+ off += n;
}
e = buf + BUFSZ;
}