view tests/test-eol.out @ 11512:488a80c840ac stable

mercurial.spec: rename docutils to python-docutils in BuildRequires Even though the name of the project is Docutils, most packagers use the package name python-docutils to fit into the naming scheme of other packages written in Python. The name is used by Fedora, EPEL, DAG, Mandriva, and a few other distributions.
author Julian Cowley <julian@lava.net>
date Fri, 02 Jul 2010 14:14:30 -1000
parents 0bb67503ad4b
children
line wrap: on
line source

% setup LF repository
adding .hgeol
adding a.txt

% hg clone repo repo-LF
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
% printrepr.py a.txt
first
second
third
% hg cat a.txt
first
second
third
% printrepr.py a.txt
first
second
third
fourth
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first
 second
 third
+fourth
% switching encoding from '\n' to '\r\n'
% hg diff only reports a single changed line:
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first
 second
 third
+fourth
% reverting back to LF format
first
second
third
% hg commit of inconsistent .txt file marked as binary (should work)
% hg commit of inconsistent .txt file marked as native (should fail)
abort: inconsistent newline style in a.txt

% hg commit --config eol.only-consistent=False (should work)
% hg commit of binary .txt file marked as native (binary files always okay)
% hg clone repo repo-CRLF
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
% printrepr.py a.txt
first\r
second\r
third\r
% hg cat a.txt
first
second
third
% printrepr.py a.txt
first\r
second\r
third\r
fourth\r
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first
 second
 third
+fourth
% switching encoding from '\r\n' to '\n'
% hg diff only reports a single changed line:
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first
 second
 third
+fourth
% reverting back to CRLF format
first\r
second\r
third\r
% hg commit of inconsistent .txt file marked as binary (should work)
% hg commit of inconsistent .txt file marked as native (should fail)
abort: inconsistent newline style in a.txt

% hg commit --config eol.only-consistent=False (should work)
% hg commit of binary .txt file marked as native (binary files always okay)
% setup CRLF repository
adding .hgeol
adding a.txt

% hg clone repo repo-LF
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
% printrepr.py a.txt
first
second
third
% hg cat a.txt
first\r
second\r
third\r
% printrepr.py a.txt
first
second
third
fourth
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first\r
 second\r
 third\r
+fourth\r
% switching encoding from '\n' to '\r\n'
% hg diff only reports a single changed line:
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first\r
 second\r
 third\r
+fourth\r
% reverting back to LF format
first
second
third
% hg commit of inconsistent .txt file marked as binary (should work)
% hg commit of inconsistent .txt file marked as native (should fail)
abort: inconsistent newline style in a.txt

% hg commit --config eol.only-consistent=False (should work)
% hg commit of binary .txt file marked as native (binary files always okay)
% hg clone repo repo-CRLF
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
% printrepr.py a.txt
first\r
second\r
third\r
% hg cat a.txt
first\r
second\r
third\r
% printrepr.py a.txt
first\r
second\r
third\r
fourth\r
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first\r
 second\r
 third\r
+fourth\r
% switching encoding from '\r\n' to '\n'
% hg diff only reports a single changed line:
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,3 +1,4 @@
 first\r
 second\r
 third\r
+fourth\r
% reverting back to CRLF format
first\r
second\r
third\r
% hg commit of inconsistent .txt file marked as binary (should work)
% hg commit of inconsistent .txt file marked as native (should fail)
abort: inconsistent newline style in a.txt

% hg commit --config eol.only-consistent=False (should work)
% hg commit of binary .txt file marked as native (binary files always okay)

# setup LF repository
adding unix.txt
adding win.txt
# setting repository-native EOLs to LF
adding .hgeol

% hg clone mixed mixed-LF
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg status (eol extension not yet activated)
% hg status (eol activated)
M win.txt
% hg commit
% hg status

% hg clone mixed mixed-CRLF
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg status (eol extension not yet activated)
% hg status (eol activated)
M win.txt
% hg commit
% hg status

# setup CRLF repository
adding unix.txt
adding win.txt
# setting repository-native EOLs to CRLF
adding .hgeol

% hg clone mixed mixed-LF
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg status (eol extension not yet activated)
% hg status (eol activated)
M unix.txt
% hg commit
% hg status

% hg clone mixed mixed-CRLF
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% hg status (eol extension not yet activated)
% hg status (eol activated)
M unix.txt
% hg commit
% hg status