[PATCH] Display symlink or executable bit with manifest -v
Giorgos Keramidas
keramida at ceid.upatras.gr
Mon Oct 8 01:31:50 UTC 2007
On 2007-10-08 00:40, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> 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
Here's a complete patch of the changes outlined above:
----- patch starts here ------------------------------------------------
# HG changeset patch
# User Giorgos Keramidas <keramida at ceid.upatras.gr>
# Date 1191806995 -10800
# Node ID 260d150c3f311c43ba4c22c5ac702ca6777ed5e9
# Parent ca890c0c3f1f569241e438494d91249c80171fc7
Solaris-pkgproto(1)-like manifest output and test updates
Building upon the idea of change 8feb33c2d153, this commit
modifies the output of "hg --debug manifest" to always include a
file type column (making it easier to parse the output with
scripts and other automated tools), and uses type characters
similar to the ones printed by the pkgproto(1) utility of
Solaris.
The file type characters in use after this change are:
f regular file
x executable file
s symlink
The tests/* scripts are also updated to account for the change
in manifets output.
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)
diff --git a/tests/test-basic.out b/tests/test-basic.out
--- a/tests/test-basic.out
+++ b/tests/test-basic.out
@@ -4,7 +4,7 @@ date: Mon Jan 12 13:46:40 1970 +0
date: Mon Jan 12 13:46:40 1970 +0000
summary: test
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
+b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 f a
a
checking changesets
checking manifests
diff --git a/tests/test-convert-filemap.out b/tests/test-convert-filemap.out
--- a/tests/test-convert-filemap.out
+++ b/tests/test-convert-filemap.out
@@ -17,13 +17,13 @@ o 0 "0: add foo baz dir/" files: baz di
o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 foo
% final file versions in this repo:
-9463f52fe115e377cf2878d4fc548117211063f2 644 bar
-94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
-6ca237634e1f6bee1b6db94292fb44f092a25842 644 copied
-3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file
-75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
+9463f52fe115e377cf2878d4fc548117211063f2 644 f bar
+94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 f baz
+6ca237634e1f6bee1b6db94292fb44f092a25842 644 f copied
+3e20847584beff41d7cd16136b7331ab3d754be0 644 f dir/file
+75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 f dir/file2
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo
+bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 f quux
copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
% foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
@@ -35,7 +35,7 @@ o 1 "2: change foo" files: foo
|
o 0 "0: add foo baz dir/" files: foo
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo
% bar: merges are not merges anymore
o 4 "7: second merge; change bar" files: bar
|
@@ -47,7 +47,7 @@ o 1 "3: change bar quux" files: bar
|
o 0 "1: add bar quux; copy foo to copied" files: bar
-9463f52fe115e377cf2878d4fc548117211063f2 644 bar
+9463f52fe115e377cf2878d4fc548117211063f2 644 f bar
% baz: 1st merge is not a merge anymore; 2nd still is
o 4 "7: second merge; change bar" files: baz
|\
@@ -59,7 +59,7 @@ o 1 "4: first merge; change bar baz" fi
|
o 0 "0: add foo baz dir/" files: baz
-94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
+94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 f baz
% foo quux: we add additional merges when they are interesting
o 8 "8: change foo" files: foo
|
@@ -79,15 +79,15 @@ o 1 "1: add bar quux; copy foo to copie
|
o 0 "0: add foo baz dir/" files: foo
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo
+bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 f quux
% bar quux: partial conversion
o 1 "3: change bar quux" files: bar quux
|
o 0 "1: add bar quux; copy foo to copied" files: bar quux
-b79105bedc55102f394e90a789c9c380117c1b4a 644 bar
-db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux
+b79105bedc55102f394e90a789c9c380117c1b4a 644 f bar
+db0421cc6b685a458c8d86c7d5c004f94429ea23 644 f quux
% bar quux: complete the partial conversion
o 4 "7: second merge; change bar" files: bar
|
@@ -99,12 +99,12 @@ o 1 "3: change bar quux" files: bar quu
|
o 0 "1: add bar quux; copy foo to copied" files: bar quux
-9463f52fe115e377cf2878d4fc548117211063f2 644 bar
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
+9463f52fe115e377cf2878d4fc548117211063f2 644 f bar
+bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 f quux
% foo: partial conversion
o 0 "0: add foo baz dir/" files: foo
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
+2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 f foo
% foo: complete the partial conversion
o 3 "8: change foo" files: foo
|
@@ -114,11 +114,11 @@ o 1 "2: change foo" files: foo
|
o 0 "0: add foo baz dir/" files: foo
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo
% copied: copied file; source not included in new repo
o 0 "1: add bar quux; copy foo to copied" files: copied
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied
+2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 f copied
copied not renamed
% foo copied: copied file; source included in new repo
o 4 "8: change foo" files: foo
@@ -131,8 +131,8 @@ o 1 "1: add bar quux; copy foo to copie
|
o 0 "0: add foo baz dir/" files: foo
-6ca237634e1f6bee1b6db94292fb44f092a25842 644 copied
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
+6ca237634e1f6bee1b6db94292fb44f092a25842 644 f copied
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo
copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
o 4 "8: change foo" files: foo2
|
@@ -144,9 +144,9 @@ o 1 "1: add bar quux; copy foo to copie
|
o 0 "0: add foo baz dir/" files: dir2/file foo2
-e5e3d520be9be45937d0b06b004fadcd6c221fa2 644 copied2
-3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/file
-9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2
+e5e3d520be9be45937d0b06b004fadcd6c221fa2 644 f copied2
+3e20847584beff41d7cd16136b7331ab3d754be0 644 f dir2/file
+9a7b52012991e4873687192c3e17e61ba3e837a3 644 f foo2
copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
copied:
foo
diff --git a/tests/test-empty-file.out b/tests/test-empty-file.out
--- a/tests/test-empty-file.out
+++ b/tests/test-empty-file.out
@@ -14,6 +14,6 @@ 1 files updated, 0 files merged, 0 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
M empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty1
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty3
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 f empty1
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 f empty2
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 f empty3
diff --git a/tests/test-excessive-merge.out b/tests/test-excessive-merge.out
--- a/tests/test-excessive-merge.out
+++ b/tests/test-excessive-merge.out
@@ -43,17 +43,17 @@ summary: test
4 275 29 3 4 f6c172c6198c 448a8c5e42f1 7c5dc2e857f2
1
-79d7492df40aa0fa093ec4209be78043c181f094 644 a
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b
+79d7492df40aa0fa093ec4209be78043c181f094 644 f a
+2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 f b
2
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a
-79d7492df40aa0fa093ec4209be78043c181f094 644 b
+2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 f a
+79d7492df40aa0fa093ec4209be78043c181f094 644 f b
3
-79d7492df40aa0fa093ec4209be78043c181f094 644 a
-79d7492df40aa0fa093ec4209be78043c181f094 644 b
+79d7492df40aa0fa093ec4209be78043c181f094 644 f a
+79d7492df40aa0fa093ec4209be78043c181f094 644 f b
4
-79d7492df40aa0fa093ec4209be78043c181f094 644 a
-79d7492df40aa0fa093ec4209be78043c181f094 644 b
+79d7492df40aa0fa093ec4209be78043c181f094 644 f a
+79d7492df40aa0fa093ec4209be78043c181f094 644 f b
rev offset length base linkrev nodeid p1 p2
0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
diff --git a/tests/test-filebranch.out b/tests/test-filebranch.out
--- a/tests/test-filebranch.out
+++ b/tests/test-filebranch.out
@@ -60,10 +60,10 @@ quux: we shouldn't have a merge here
0 0 3 0 0 b8e02f643373 000000000000 000000000000
1 3 5 1 3 6128c0f33108 b8e02f643373 000000000000
manifest entries should match tips of all files
-33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
-2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
-aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
-6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
+33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 f bar
+2ffeddde1b65b4827f6746174a145474129fa2ce 644 f baz
+aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 f foo
+6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 f quux
everything should be clean now
checking changesets
checking manifests
diff --git a/tests/test-git-import.out b/tests/test-git-import.out
--- a/tests/test-git-import.out
+++ b/tests/test-git-import.out
@@ -55,11 +55,11 @@ a
% binary files and regular patch hunks
applying patch from stdin
foo
-045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
+045c85ba38952325e126c70962cc0f9d9077bc67 644 f binary
% many binary files
applying patch from stdin
-045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
-a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
+045c85ba38952325e126c70962cc0f9d9077bc67 644 f mbinary1
+a874b471193996e7cb034bb301cac7bdaf3e3f46 644 f mbinary2
% filenames with spaces
applying patch from stdin
foo
diff --git a/tests/test-issue522.out b/tests/test-issue522.out
--- a/tests/test-issue522.out
+++ b/tests/test-issue522.out
@@ -13,7 +13,7 @@ 1 files updated, 0 files merged, 0 files
(branch merge, don't forget to commit)
n 0 -2 unset foo
M foo
-c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
+c6fc755d7e68f49f880599da29f15add41f42f5a 644 f foo
rev offset length base linkrev nodeid p1 p2
0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
diff --git a/tests/test-manifest.out b/tests/test-manifest.out
--- a/tests/test-manifest.out
+++ b/tests/test-manifest.out
@@ -1,12 +1,12 @@ a
a
b/a
l
-644 a
-755 * b/a
-644 @ l
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
-b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
-047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
+644 f a
+755 x b/a
+644 s l
+b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 f a
+b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 x b/a
+047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 s l
a
l
a
diff --git a/tests/test-merge6.out b/tests/test-merge6.out
--- a/tests/test-merge6.out
+++ b/tests/test-merge6.out
@@ -11,7 +11,7 @@ 1 files updated, 0 files merged, 0 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
bar should remain deleted.
-f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo
+f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 f foo
pulling from ../A2
searching for changes
adding changesets
@@ -22,4 +22,4 @@ 0 files updated, 0 files merged, 1 files
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
bar should remain deleted.
-f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo
+f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 f foo
diff --git a/tests/test-pull.out b/tests/test-pull.out
--- a/tests/test-pull.out
+++ b/tests/test-pull.out
@@ -17,7 +17,7 @@ 1 files, 1 changesets, 1 total revisions
1 files, 1 changesets, 1 total revisions
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
foo
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
+2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 f foo
pulling from http://localhost/
searching for changes
no changes found
diff --git a/tests/test-rawcommit1.out b/tests/test-rawcommit1.out
--- a/tests/test-rawcommit1.out
+++ b/tests/test-rawcommit1.out
@@ -1,9 +1,9 @@ 05f9e54f4c9b86b09099803d8b49a50edcb4eaab
-05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
-54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
+05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 f a
+54837d97f2932a8194e69745a280a2c11e61ff9c 644 f b
(the rawcommit command is deprecated)
-05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
-54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
-76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
+05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 f a
+54837d97f2932a8194e69745a280a2c11e61ff9c 644 f b
+76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 f c
changeset: 2:e110db3db549
tag: tip
user: test
@@ -14,8 +14,8 @@ 2
(the rawcommit command is deprecated)
-05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
-76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
+05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 f a
+76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 f c
changeset: 3:20652cf30cc0
tag: tip
user: test
@@ -26,8 +26,8 @@ 3
(the rawcommit command is deprecated)
-d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
-76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
+d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 f a
+76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 f c
changeset: 4:42556b925639
tag: tip
user: test
@@ -38,9 +38,9 @@ 4
(the rawcommit command is deprecated)
-05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
-54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
-3570202ceac2b52517df64ebd0a062cb0d8fe33a 644 c
+05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 f a
+54837d97f2932a8194e69745a280a2c11e61ff9c 644 f b
+3570202ceac2b52517df64ebd0a062cb0d8fe33a 644 f c
changeset: 4:42556b925639
user: test
date: Mon Jan 12 13:46:40 1970 +0000
@@ -50,8 +50,8 @@ 4
(the rawcommit command is deprecated)
-d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
-76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
+d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 f a
+76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 f c
changeset: 6:8a0c9254b0ab
tag: tip
parent: 4:42556b925639
@@ -63,8 +63,8 @@ 6
(the rawcommit command is deprecated)
-d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
-76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
+d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 f a
+76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 f c
changeset: 7:a5a6e1f312b9
tag: tip
user: test
diff --git a/tests/test-simple-update.out b/tests/test-simple-update.out
--- a/tests/test-simple-update.out
+++ b/tests/test-simple-update.out
@@ -21,4 +21,4 @@ 1 files updated, 0 files merged, 0 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
foo
bar
-6f4310b00b9a147241b071a60c28a650827fb03d 644 foo
+6f4310b00b9a147241b071a60c28a650827fb03d 644 f foo
diff --git a/tests/test-symlink-basic.out b/tests/test-symlink-basic.out
--- a/tests/test-symlink-basic.out
+++ b/tests/test-symlink-basic.out
@@ -8,7 +8,7 @@ add symlink
add symlink
-2564acbe54bbbedfbf608479340b359f04597f80 644 @ dangling
+2564acbe54bbbedfbf608479340b359f04597f80 644 s dangling
% rev 0:
dangling -> nothing
% rev 1:
----- patch ends here --------------------------------------------------
More information about the Mercurial-devel
mailing list