For pcl-cvs, I wrote a function 'cvs-dtrt' (cvs- Do The Right Thing)
which knows what to do for each file in a status buffer.
For example, if the file is modified, cvs-dtrt pops up ediff against
the head revision of the current branch, with a separate Emacs frame
displaying the "commit comments" buffer.
If a file is unknown, cvs-dtrt prompts for add, ignore, or delete.
This is possible because the ewoc cookie in pcl-cvs stores the status
of each file, and cvs-dtrt queries it.
I'd like to do the same for dvc.
First, I need to know what the letters in the 'status' field of a
'file element in dvc-diff-cookie mean, and update the backends (at
least bzr and mtn) to respect the definitions.
There is also the 'modified' field, which is apparently 'M' for
modified, and ' ' for not. Although xmtn sets it to other values.
dvc-diff.el says the possible letters for status are: 'CRADP?'
bzr-parse-status always sets status and modified to " ". I'd like to
change that to be more meaningful.
xmtn--parse-diff-for-dvc has:
(ecase status
(deleted "D") ; conflict?
(renamed "R")
(() "?") ; unknown
(() "C") ; conflict
(() "P")
(added "A")
(modified "M")
(unchanged " "))
(ecase modif
(added "A")
(modified "M")
(renamed "R")
(() "C")
(deleted "D")
(unchanged " "))
I tried reading the code for tla-dvc-status, but I could not figure
out if it sets this field, or what it uses the letters for.
cg.el has :
(cond (added "A")
(removed "D")
(t " "))
(cond ((or added removed) " ")
(t "M"))
xdarcs just copies the letter from the darcs output; I don't know what
darcs means by them.
pcl-cvs defines the following values for status:
ADDED
CONFLICT
MISSING
MODIFIED
NEED-MERGE
NEED-UPDATE
REMOVED
UNKNOWN
Based on the above, I propose the following definitions.
For modified, I suggest we always set it to " ", and use status
instead.
For status (with corresponding pcl-cvs meaning):
"A" added ADDED
"C" conflict CONFLICT
"D" deleted REMOVED
"R" renamed
"M" modified MODIFIED
"m" missing MISSING
"?" unknown UNKNOWN
" " unchanged
This adds "M", "m", and " " to the list of possible values for status,
and removes "P".
"m" 'missing' means deleted from the working directory, but not yet
marked for deletion from the backend repository.
"D" 'deleted' means marked for deletion from backend repository, but not
necessarily deleted from the working directory. If not yet deleted
from the working directory, that should happen during commit.
This leaves out the pcl-cvs values NEED-MERGE and NEED-UPDATE.
NEED-MERGE occurs when a file is changed in the cvs repository (by
someone else) and in the local working directory. I think that's
impossible in the backends dvc is intended for.
NEED-UPDATE is sometimes the same as MISSING, other times it means the
repository has been updated. I think the latter meaning is not
possible in dvc.
I'd like to add field access functions for the ewoc cookie. For
example:
(defun dvc-diff-ewoc->filename (elem)
"Filename field of ELEM, assumed to be of type 'file."
(nth 1 elem))
(defun dvc-diff-ewoc->type (elem)
"Type field of ELEM; one of: 'file, 'subtree, 'message, 'searching-subtrees."
(car elem))
For dvc-diff-ewoc->status, I'd like to return atoms, rather than
letters; they are more readable in case statements. The atoms would be
the second column in the above table (ie 'added for "A").
--
-- Stephe
_______________________________________________
Dvc-dev mailing list
[EMAIL PROTECTED]
https://mail.gna.org/listinfo/dvc-dev