I would it find useful of fossil would provide a means to directly provide the functionality of this script:

8<---------------------------------------------
#!/usr/bin/env ksh
# construct *CURRENT* revision info string plus indication of any changes to the checkout

revnum=$(
   fossil status|\
   awk -F'checkout:[ ]*' '
      /^checkout/ {
         print substr($NF, 1, 10)
      }
   '
)
changes=$(fossil changes)
[[ -z $changes ]] || changes=+
print $revnum$changes
8<---------------------------------------------

which simply echoes (the first 10 chars of) the sha1 hash of the *CURRENT* checkout and appends a `+' if the checkout has any changes relative to the repository state at this revision. `hg' users might be remembered of `hg id -i' ;-)

I find this useful at least for multi-file text documents (LaTeX, AsciiDoc, etc.) for inclusion of auto-generated revision information in the final formatted document (which might be circulated to co-workers) in order to keep track of what "hardcopy" one is talking about. in this situation (multiple files containing different chapters, included graphics, etc.), `fossil finfo -s doc.tex' would _not_ provide the same functionality (for a single-file document it would). of course it would be nicer to have this functionality as a fossil command instead of as a separate script so that the document "compiles" for others as well (without having to include the script in each and every repo needing this).

if considered acceptable I propose to use `fossil status -s' to get this sort of output (or imitate `hg' and define a new `id' command).

j.
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to