[PATCH] Display symlink or executable bit with manifest -v

Giorgos Keramidas keramida at ceid.upatras.gr
Sun Oct 7 21:40:02 UTC 2007


On 2007-10-06 00:56, Patrick Mezard <pmezard at gmail.com> wrote:
> # HG changeset patch
> # User Patrick Mezard <pmezard at gmail.com>
> # Date 1191624801 -7200
> # Node ID 72a6b343c7298359ea83406588d041d2c5584254
> # Parent  e73a83af79267ea9f08a8b7fe7498dbd5f4539c5
> Display symlink or executable bit with manifest -v
>
> New output looks like:
>
> 644   a
> 755 * b/a
> 644 @ l

It would be nice if we didn't have to 'guess' if the second field is a
filename or a file-type, so I'd prefer to see this written as:

    644 f a
    755 * b/a
    644 @ l

Another thought that is probably nit-picking but may be useful, is that
I think we should reuse the file-type letters of Solaris packaging or
something similar, instead of inventing a new set of file type letters.
If we do, we can output something similar to:

    644 f a
    755 f b/a
    644 s l

We don't need _all_ the file types supported by Solaris packaging lists,
like:

    d directory
    f file
    s symbolic link
    ...

since we don't really track changes to directories, and we don't have a
particularly pressing need for 'modifiable' flags and other stuff
supported by the SysV packaging list format, but making the output more
familiar to people who do this sort of thing seems like a plus :-)

A third point is that we don't need a special '*' or 'x' for
'executable' because that can be inferred from the mode, but if that is
really necessary, it's probably ok to use a slightly modified version:

    644 f a
    755 x b/a
    644 s l

The only change needed to make this happen is something like:

%%%
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1902,7 +1902,7 @@ def manifest(ui, repo, node=None, rev=No
         if ui.debugflag:
             ui.write("%40s " % hex(m[f]))
         if ui.verbose:
-            type = m.execf(f) and "*" or m.linkf(f) and "@" or " "
+            type = m.execf(f) and "x" or m.linkf(f) and "s" or "f"
             perm = m.execf(f) and "755" or "644"
             ui.write("%3s %1s " % (perm, type))
         ui.write("%s\n" % f)
%%%

and any related changes to unbreak the tests/* scripts.

If this sounds like a reasonable enhancement, I can update the tests/*
files and email the patch :)




More information about the Mercurial-devel mailing list