diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-16 02:50:52 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-16 02:50:52 +0200 |
commit | 18bfca7978bdaf7dc96e4b1a5b64ae9283856782 (patch) | |
tree | 038be318e57288b8ad242e1459cd7172dbd8acf2 | |
parent | 6039c95bcbcc70e1ab1a476d0d54f9f1d3fac183 (diff) |
hgfs: add rev file, document in manual page
-rw-r--r-- | sys/man/4/hgfs | 15 | ||||
-rw-r--r-- | sys/src/cmd/hgfs/fs.c | 7 |
2 files changed, 15 insertions, 7 deletions
diff --git a/sys/man/4/hgfs b/sys/man/4/hgfs index 84c1519c6..c97d7aaa5 100644 --- a/sys/man/4/hgfs +++ b/sys/man/4/hgfs @@ -59,15 +59,15 @@ corresponding to a specific changeset revision in the repository. Revision directories are named by a revision id which -takes the form [\fId\fB.\fR]\fIhhhhhhhhhhhh\fR, where +takes the form [\fId\fB.\fR]\fIh\fR, where .I d is the decimal revision number starting from 0 and -.I hhhhhhhhhhhh -is the hexadecimal hash prefix of the changeset. Both +.I h +is the hexadecimal hash of the changeset. Both the revision number .I d -and the hash prefix -.I hhhhhhhhhhhh +and the hash +.I h are able to identify a revision uniquely; only one of them needs to be given when walking the root directory. The hexadecimal hash @@ -79,8 +79,11 @@ in the directory listing. In each revision directory the following files can be found: .TP +.B rev +contains the revision id of the changeset. +.TP .B rev1 -contains the parent revision id as text. +contains the parent revision id of the changeset. .TP .B rev2 If the changeset was a merge, contains the other parent revision id. Otherwise, a zero size file. diff --git a/sys/src/cmd/hgfs/fs.c b/sys/src/cmd/hgfs/fs.c index 69455b2e2..9bc314577 100644 --- a/sys/src/cmd/hgfs/fs.c +++ b/sys/src/cmd/hgfs/fs.c @@ -13,6 +13,7 @@ enum { Qroot, Qrev, + Qrev0, Qrev1, Qrev2, Qlog, @@ -27,6 +28,7 @@ enum { static char *nametab[] = { "/", nil, + "rev", "rev1", "rev2", "log", @@ -182,6 +184,7 @@ fsmkqid(Qid *q, int level, void *aux) case Qchanges: q->type = QTDIR; if(0){ + case Qrev0: case Qrev1: case Qrev2: case Qlog: @@ -237,6 +240,7 @@ fsmkdir(Dir *d, int level, void *aux) case Qroot: goto Namegen; case Qrev: + case Qrev0: case Qrev1: case Qrev2: ri = aux; @@ -638,6 +642,7 @@ fsread(Req *r) dirread9p(r, revgen, rf->info); respond(r, nil); return; + case Qrev0: case Qrev1: case Qrev2: s = nil; @@ -646,7 +651,7 @@ fsread(Req *r) i = hashrev(&changelog, rf->info->chash); if(rf->level == Qrev1) i = changelog.map[i].p1rev; - else + else if(rf->level == Qrev2) i = changelog.map[i].p2rev; Revgen: s = fsmkrevname(buf, sizeof(buf), i); |