hgfs: add rev file, document in manual page

This commit is contained in:
cinap_lenrek 2011-10-16 02:50:52 +02:00
parent 6039c95bcb
commit 18bfca7978
2 changed files with 15 additions and 7 deletions

View file

@ -59,15 +59,15 @@ corresponding to a specific changeset revision in the
repository. repository.
Revision directories are named by a revision id which 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 .I d
is the decimal revision number starting from 0 and is the decimal revision number starting from 0 and
.I hhhhhhhhhhhh .I h
is the hexadecimal hash prefix of the changeset. Both is the hexadecimal hash of the changeset. Both
the revision number the revision number
.I d .I d
and the hash prefix and the hash
.I hhhhhhhhhhhh .I h
are able to identify are able to identify
a revision uniquely; only one of them needs to be given a revision uniquely; only one of them needs to be given
when walking the root directory. The hexadecimal hash 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: In each revision directory the following files can be found:
.TP .TP
.B rev
contains the revision id of the changeset.
.TP
.B rev1 .B rev1
contains the parent revision id as text. contains the parent revision id of the changeset.
.TP .TP
.B rev2 .B rev2
If the changeset was a merge, contains the other parent revision id. Otherwise, a zero size file. If the changeset was a merge, contains the other parent revision id. Otherwise, a zero size file.

View file

@ -13,6 +13,7 @@
enum { enum {
Qroot, Qroot,
Qrev, Qrev,
Qrev0,
Qrev1, Qrev1,
Qrev2, Qrev2,
Qlog, Qlog,
@ -27,6 +28,7 @@ enum {
static char *nametab[] = { static char *nametab[] = {
"/", "/",
nil, nil,
"rev",
"rev1", "rev1",
"rev2", "rev2",
"log", "log",
@ -182,6 +184,7 @@ fsmkqid(Qid *q, int level, void *aux)
case Qchanges: case Qchanges:
q->type = QTDIR; q->type = QTDIR;
if(0){ if(0){
case Qrev0:
case Qrev1: case Qrev1:
case Qrev2: case Qrev2:
case Qlog: case Qlog:
@ -237,6 +240,7 @@ fsmkdir(Dir *d, int level, void *aux)
case Qroot: case Qroot:
goto Namegen; goto Namegen;
case Qrev: case Qrev:
case Qrev0:
case Qrev1: case Qrev1:
case Qrev2: case Qrev2:
ri = aux; ri = aux;
@ -638,6 +642,7 @@ fsread(Req *r)
dirread9p(r, revgen, rf->info); dirread9p(r, revgen, rf->info);
respond(r, nil); respond(r, nil);
return; return;
case Qrev0:
case Qrev1: case Qrev1:
case Qrev2: case Qrev2:
s = nil; s = nil;
@ -646,7 +651,7 @@ fsread(Req *r)
i = hashrev(&changelog, rf->info->chash); i = hashrev(&changelog, rf->info->chash);
if(rf->level == Qrev1) if(rf->level == Qrev1)
i = changelog.map[i].p1rev; i = changelog.map[i].p1rev;
else else if(rf->level == Qrev2)
i = changelog.map[i].p2rev; i = changelog.map[i].p2rev;
Revgen: Revgen:
s = fsmkrevname(buf, sizeof(buf), i); s = fsmkrevname(buf, sizeof(buf), i);