Menu

Tree [b618f2] default tip /
 History

Read Only access


File Date Author Commit
 .hgignore 2022-01-05 ggb ggb [82b4bc] Initial load
 README.md 2022-01-07 ggb ggb [b618f2] Readme fixed as hook cannot tell accurately whe...
 edit 2022-01-05 ggb ggb [82b4bc] Initial load
 stat-repos 2022-01-06 ggb ggb [629d86] Rename again

Read Me

Report state of mercurial repositories

Overview

This utility will traverse down through a directory tree and identify all mercurial repositories found within the tree.

Environment

This utility will only function using the bash scripting language in Linux.

Mercurial hooks

The utility utilises a number of simple hooks that should be included in the Mercurial configuration file. This may be the users configuration file (at $HOME/.hgrc) or the system wide configuration file (at /etc/mercurial/hgrc or in /etc/mercurial/hgrc.d/).

The following lines should be included within the files:

[hooks]
# The following lines were added to help find-repos utility.
commit = echo >>./.hg/hgactivity.log "$(date '+%F %T') : Committed."
preoutgoing = echo >>./.hg/hgactivity.log "$(date '+%F %T') : Sent."

The absence of these lines in the configuration file will not cause the utility to fail, but it will reduce the information it can report on.

Execution

The format of the command to invoke the utility is:

stat-repos list-of-directories

Each of the directories included in the list-of-directories will be searched for included repositories.

Example

stat-repos . ../show-user

Output

Searching:"/home/ggb/Dev/stat-repos"
-   Repo: "/home/ggb/Dev/stat-repos"
    Last-action: "2022-01-06 00:16:54 : Committed"
    Status:
    -   branch: default
        commit: 1 unknown (clean)
    Paths:


---
Searching:"/home/ggb/Dev/show-user"
-   Repo: "/home/ggb/Dev/show-user"
    Last-action: "2022-01-06 22:21:35 : Committed"
    Status:
    -   branch: default
        commit: (clean)
    Paths:
    -   default: "ssh://ggb-sw@hg.code.sf.net/p/showuser/code"

---

The output is valid YAML.

Each directory in the list specified on command line will generate a seperate YAML document (seperated by --- ).

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.