view tests/test-import.out @ 11769:ca6cebd8734e stable

dirstate: ignore symlinks when fs cannot handle them (issue1888) When the filesystem cannot handle the executable bit, we currently ignore it completely when looking for modified files. Similarly, it is impossible to set or clear the bit when the filesystem ignores it. This patch makes Mercurial treat symbolic links the same way. Symlinks are a little different since they manifest themselves as small files containing a filename (the symlink target). On Windows, these files show up as regular files, and on Linux and Mac they show up as real symlinks. Issue1888 presents a case where the symlink files are better ignored from the Windows side. A Linux client creates symlinks in a working copy which is shared over a network between Linux and Windows clients. The Samba server is helpful and defererences the symlink when the Windows client looks at it. This means that Mercurial on the Windows side sees file content instead of a file name in the symlink, and hence flags the link as modified. Ignoring the change would be much more helpful, similarly to how Mercurial does not report any changes when executable bits are ignored in a checkout on Windows. An initial checkout of a symbolic link on a file system that cannot handle symbolic links will still result in a regular file containing the target file name as its content. Sharing such a checkout with a Linux client will not turn the file into a symlink automatically, but 'hg revert' can fix that. After the revert, the Windows client will see the correct file content (provided by the Samba server when it follows the link on the Linux side) and otherwise ignore the change. Running 'hg perfstatus' 10 times gives these results: Before: After: min: 0.544703 min: 0.546549 med: 0.547592 med: 0.548881 avg: 0.549146 avg: 0.548549 max: 0.564112 max: 0.551504 The median time is increased about 0.24%.
author Martin Geisler <mg@aragost.com>
date Mon, 09 Aug 2010 15:31:56 +0200
parents f5be44090ba8
children
line wrap: on
line source

adding a
adding d1/d2/a
% import exported patch
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
% message should be same
summary:     second change
% committer should be same
user:        someone
% import exported patch with external patcher
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
line2
% import of plain diff should fail without message
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
abort: empty commit message
% import of plain diff should be ok with message
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
% import of plain diff with specific date and user
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
changeset:   1:ca68f19f3a40
tag:         tip
user:        user@nowhere.net
date:        Thu Jan 01 00:00:01 1970 +0000
files:       a
description:
patch


diff -r 80971e65b431 -r ca68f19f3a40 a
--- a/a	Thu Jan 01 00:00:00 1970 +0000
+++ b/a	Thu Jan 01 00:00:01 1970 +0000
@@ -1,1 +1,2 @@
 line 1
+line 2

% import of plain diff should be ok with --no-commit
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../tip.patch
diff -r 80971e65b431 a
--- a/a
+++ b/a
@@ -1,1 +1,2 @@
 line 1
+line 2
% hg -R repo import
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying tip.patch
% import from stdin
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
% import two patches in one stream
applying patch from stdin
applied 80971e65b431
1d4bd90af0e4 tip
1d4bd90af0e4 tip
% override commit message
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
summary:     override
% plain diff in email, subject, message body
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../msg.patch
user:        email patcher
summary:     email patch
% plain diff in email, no subject, message body
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
% plain diff in email, subject, no message body
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
% plain diff in email, no subject, no message body, should fail
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
abort: empty commit message
% hg export in email, should use patch header
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
summary:     second change
% plain diff in email, [PATCH] subject, message body with subject
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin
email patch

next line
---
% import patch1 patch2; rollback
parent: 0
applying ../patch1
applying ../patch2
applied 1d4bd90af0e4
rolling back to revision 1 (undo commit)
parent: 1
% hg import in a subdirectory
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying ../../../tip.patch
% message should be 'subdir change'
summary:     subdir change
% committer should be 'someoneelse'
user:        someoneelse
% should be empty
% test fuzziness
adding a
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
created new head
applying tip.patch
patching file a
Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
reverting a
% test fuzziness with eol=auto
applying tip.patch
patching file a
Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
adding a
adding b1
adding c1
adding d
diff --git a/a b/a
--- a/a
+++ b/a
@@ -0,0 +1,1 @@
+a
diff --git a/b1 b/b2
rename from b1
rename to b2
--- a/b1
+++ b/b2
@@ -0,0 +1,1 @@
+b
diff --git a/c1 b/c1
--- a/c1
+++ b/c1
@@ -0,0 +1,1 @@
+c
diff --git a/c1 b/c2
copy from c1
copy to c2
--- a/c1
+++ b/c2
@@ -0,0 +1,1 @@
+c
diff --git a/d b/d
--- a/d
+++ b/d
@@ -1,1 +0,0 @@
-d
4 files updated, 0 files merged, 2 files removed, 0 files unresolved
applying empty.diff
% a file
a
% b1 file
% b2 file
b
% c1 file
c
% c2 file
c
% d file
% test trailing binary removal
adding a
adding b
R a
R b
diff --git a/a b/a
diff --git a/b b/b
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying remove.diff
% test update+rename with common name (issue 927)
adding a
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
applying copy.diff
% view a
a
% view a2
a
% test -p0
adding a
applying patch from stdin
bb
% test paths outside repo root
applying patch from stdin
abort: ../outside/foo not under root
% test import with similarity and git and strip (issue295 et al.)
adding a
applying ../rename.diff
patching file a
patching file b
removing a
adding b
recording removal of a as rename to b (88% similar)
A b
  a
R a
undeleting a
forgetting b
applying ../rename.diff
patching file a
patching file b
removing a
adding b
A b
R a
% add empty file from the end of patch (issue 1495)
adding a
applying a.patch
% create file when source is not /dev/null
applying ../create.patch
a
applying ../create2.patch
a
% first line mistaken for email headers (issue 1859)
applying a.patch
changeset:   0:5a681217c0ad
tag:         tip
user:        test
date:        Thu Jan 01 00:00:00 1970 +0000
files:       a
description:
module: summary

description


% --- in commit message
applying a.patch
changeset:   0:f34d9187897d
tag:         tip
user:        test
date:        Thu Jan 01 00:00:00 1970 +0000
files:       a
description:
module: summary


% tricky header splitting
applying ../trickyheaders.patch
# HG changeset patch
# User User B
# Date 0 0
# Node ID eb56ab91903632294ac504838508cb370c0901d2
# Parent  0000000000000000000000000000000000000000
from: tricky!

That is not a header.

diff --git a/foo b/foo
new file mode 100644
--- /dev/null
+++ b/foo
@@ -0,0 +1,1 @@
+foo
% issue2102
adding src/cmd/gc/mksys.bash
applying patch from stdin
parent: 1:d59915696727 tip
 help management of empty pkg and lib directories in perforce
branch: default
commit: (clean)
update: (current)
diff --git a/lib/place-holder b/lib/place-holder
new file mode 100644
--- /dev/null
+++ b/lib/place-holder
@@ -0,0 +1,2 @@
+perforce does not maintain empty directories.
+this file helps.
diff --git a/pkg/place-holder b/pkg/place-holder
new file mode 100644
--- /dev/null
+++ b/pkg/place-holder
@@ -0,0 +1,2 @@
+perforce does not maintain empty directories.
+this file helps.
diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
old mode 100644
new mode 100755
% diff lines looking like headers
adding a
adding b
adding c
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
applying patch from stdin