Show More
@@ -1,201 +1,200 b'' | |||||
1 | #require test-repo |
|
1 | #require test-repo | |
2 |
|
2 | |||
3 | $ cd "$TESTDIR"/.. |
|
3 | $ cd "$TESTDIR"/.. | |
4 |
|
4 | |||
5 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py |
|
5 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py | |
6 | doc/check-seclevel.py not using absolute_import |
|
6 | doc/check-seclevel.py not using absolute_import | |
7 | doc/gendoc.py not using absolute_import |
|
7 | doc/gendoc.py not using absolute_import | |
8 | doc/hgmanpage.py not using absolute_import |
|
8 | doc/hgmanpage.py not using absolute_import | |
9 | hgext/color.py not using absolute_import |
|
9 | hgext/color.py not using absolute_import | |
10 | hgext/eol.py not using absolute_import |
|
10 | hgext/eol.py not using absolute_import | |
11 | hgext/extdiff.py not using absolute_import |
|
11 | hgext/extdiff.py not using absolute_import | |
12 | hgext/factotum.py not using absolute_import |
|
12 | hgext/factotum.py not using absolute_import | |
13 | hgext/fetch.py not using absolute_import |
|
13 | hgext/fetch.py not using absolute_import | |
14 | hgext/fsmonitor/pywatchman/__init__.py not using absolute_import |
|
14 | hgext/fsmonitor/pywatchman/__init__.py not using absolute_import | |
15 | hgext/fsmonitor/pywatchman/__init__.py requires print_function |
|
15 | hgext/fsmonitor/pywatchman/__init__.py requires print_function | |
16 | hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import |
|
16 | hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import | |
17 | hgext/fsmonitor/pywatchman/pybser.py not using absolute_import |
|
17 | hgext/fsmonitor/pywatchman/pybser.py not using absolute_import | |
18 | hgext/gpg.py not using absolute_import |
|
18 | hgext/gpg.py not using absolute_import | |
19 | hgext/graphlog.py not using absolute_import |
|
19 | hgext/graphlog.py not using absolute_import | |
20 | hgext/hgcia.py not using absolute_import |
|
20 | hgext/hgcia.py not using absolute_import | |
21 | hgext/hgk.py not using absolute_import |
|
21 | hgext/hgk.py not using absolute_import | |
22 | hgext/highlight/__init__.py not using absolute_import |
|
22 | hgext/highlight/__init__.py not using absolute_import | |
23 | hgext/highlight/highlight.py not using absolute_import |
|
23 | hgext/highlight/highlight.py not using absolute_import | |
24 | hgext/histedit.py not using absolute_import |
|
24 | hgext/histedit.py not using absolute_import | |
25 | hgext/largefiles/__init__.py not using absolute_import |
|
25 | hgext/largefiles/__init__.py not using absolute_import | |
26 | hgext/largefiles/basestore.py not using absolute_import |
|
26 | hgext/largefiles/basestore.py not using absolute_import | |
27 | hgext/largefiles/lfcommands.py not using absolute_import |
|
27 | hgext/largefiles/lfcommands.py not using absolute_import | |
28 | hgext/largefiles/lfutil.py not using absolute_import |
|
28 | hgext/largefiles/lfutil.py not using absolute_import | |
29 | hgext/largefiles/localstore.py not using absolute_import |
|
29 | hgext/largefiles/localstore.py not using absolute_import | |
30 | hgext/largefiles/overrides.py not using absolute_import |
|
30 | hgext/largefiles/overrides.py not using absolute_import | |
31 | hgext/largefiles/proto.py not using absolute_import |
|
31 | hgext/largefiles/proto.py not using absolute_import | |
32 | hgext/largefiles/remotestore.py not using absolute_import |
|
32 | hgext/largefiles/remotestore.py not using absolute_import | |
33 | hgext/largefiles/reposetup.py not using absolute_import |
|
33 | hgext/largefiles/reposetup.py not using absolute_import | |
34 | hgext/largefiles/uisetup.py not using absolute_import |
|
34 | hgext/largefiles/uisetup.py not using absolute_import | |
35 | hgext/largefiles/wirestore.py not using absolute_import |
|
35 | hgext/largefiles/wirestore.py not using absolute_import | |
36 | hgext/mq.py not using absolute_import |
|
36 | hgext/mq.py not using absolute_import | |
37 | hgext/rebase.py not using absolute_import |
|
37 | hgext/rebase.py not using absolute_import | |
38 | hgext/share.py not using absolute_import |
|
38 | hgext/share.py not using absolute_import | |
39 | hgext/win32text.py not using absolute_import |
|
39 | hgext/win32text.py not using absolute_import | |
40 | i18n/check-translation.py not using absolute_import |
|
40 | i18n/check-translation.py not using absolute_import | |
41 | i18n/polib.py not using absolute_import |
|
41 | i18n/polib.py not using absolute_import | |
42 | setup.py not using absolute_import |
|
42 | setup.py not using absolute_import | |
43 | tests/heredoctest.py requires print_function |
|
43 | tests/heredoctest.py requires print_function | |
44 | tests/killdaemons.py not using absolute_import |
|
44 | tests/killdaemons.py not using absolute_import | |
45 | tests/md5sum.py not using absolute_import |
|
45 | tests/md5sum.py not using absolute_import | |
46 | tests/mockblackbox.py not using absolute_import |
|
46 | tests/mockblackbox.py not using absolute_import | |
47 | tests/printenv.py not using absolute_import |
|
47 | tests/printenv.py not using absolute_import | |
48 | tests/readlink.py not using absolute_import |
|
48 | tests/readlink.py not using absolute_import | |
49 | tests/readlink.py requires print_function |
|
49 | tests/readlink.py requires print_function | |
50 | tests/revlog-formatv0.py not using absolute_import |
|
50 | tests/revlog-formatv0.py not using absolute_import | |
51 | tests/run-tests.py not using absolute_import |
|
51 | tests/run-tests.py not using absolute_import | |
52 | tests/sitecustomize.py not using absolute_import |
|
52 | tests/sitecustomize.py not using absolute_import | |
53 | tests/svn-safe-append.py not using absolute_import |
|
53 | tests/svn-safe-append.py not using absolute_import | |
54 | tests/svnxml.py not using absolute_import |
|
54 | tests/svnxml.py not using absolute_import | |
55 | tests/test-atomictempfile.py not using absolute_import |
|
55 | tests/test-atomictempfile.py not using absolute_import | |
56 | tests/test-demandimport.py not using absolute_import |
|
56 | tests/test-demandimport.py not using absolute_import | |
57 | tests/test-demandimport.py requires print_function |
|
57 | tests/test-demandimport.py requires print_function | |
58 | tests/test-doctest.py not using absolute_import |
|
58 | tests/test-doctest.py not using absolute_import | |
59 | tests/test-hgwebdir-paths.py not using absolute_import |
|
59 | tests/test-hgwebdir-paths.py not using absolute_import | |
60 | tests/test-lrucachedict.py not using absolute_import |
|
60 | tests/test-lrucachedict.py not using absolute_import | |
61 | tests/test-lrucachedict.py requires print_function |
|
61 | tests/test-lrucachedict.py requires print_function | |
62 | tests/test-manifest.py not using absolute_import |
|
62 | tests/test-manifest.py not using absolute_import | |
63 | tests/test-pathencode.py not using absolute_import |
|
63 | tests/test-pathencode.py not using absolute_import | |
64 | tests/test-simplemerge.py not using absolute_import |
|
|||
65 | tests/test-trusted.py requires print_function |
|
64 | tests/test-trusted.py requires print_function | |
66 |
|
65 | |||
67 | #if py3exe |
|
66 | #if py3exe | |
68 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py |
|
67 | $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py | |
69 | contrib/check-code.py: invalid syntax: (unicode error) 'unicodeescape' codec can't decode bytes in position *-*: malformed \N character escape (<unknown>, line *) (glob) |
|
68 | contrib/check-code.py: invalid syntax: (unicode error) 'unicodeescape' codec can't decode bytes in position *-*: malformed \N character escape (<unknown>, line *) (glob) | |
70 | doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
69 | doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
71 | hgext/automv.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) |
|
70 | hgext/automv.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) | |
72 | hgext/blackbox.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
71 | hgext/blackbox.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
73 | hgext/bugzilla.py: error importing module: <ImportError> No module named 'urlparse' (line *) (glob) |
|
72 | hgext/bugzilla.py: error importing module: <ImportError> No module named 'urlparse' (line *) (glob) | |
74 | hgext/censor.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
73 | hgext/censor.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
75 | hgext/chgserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob) |
|
74 | hgext/chgserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob) | |
76 | hgext/children.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
75 | hgext/children.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
77 | hgext/churn.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
76 | hgext/churn.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
78 | hgext/clonebundles.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
77 | hgext/clonebundles.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
79 | hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
78 | hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
80 | hgext/convert/bzr.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
79 | hgext/convert/bzr.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
81 | hgext/convert/common.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) |
|
80 | hgext/convert/common.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) | |
82 | hgext/convert/convcmd.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
81 | hgext/convert/convcmd.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
83 | hgext/convert/cvs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
82 | hgext/convert/cvs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
84 | hgext/convert/cvsps.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) |
|
83 | hgext/convert/cvsps.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) | |
85 | hgext/convert/darcs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
84 | hgext/convert/darcs.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
86 | hgext/convert/filemap.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
85 | hgext/convert/filemap.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
87 | hgext/convert/git.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
86 | hgext/convert/git.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
88 | hgext/convert/gnuarch.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
87 | hgext/convert/gnuarch.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
89 | hgext/convert/hg.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
88 | hgext/convert/hg.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
90 | hgext/convert/monotone.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
89 | hgext/convert/monotone.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
91 | hgext/convert/p*.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) |
|
90 | hgext/convert/p*.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *) (glob) | |
92 | hgext/convert/subversion.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) |
|
91 | hgext/convert/subversion.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) | |
93 | hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob) |
|
92 | hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob) | |
94 | hgext/eol.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
93 | hgext/eol.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
95 | hgext/extdiff.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
94 | hgext/extdiff.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
96 | hgext/factotum.py: error importing: <ImportError> No module named 'httplib' (error at url.py:*) (glob) |
|
95 | hgext/factotum.py: error importing: <ImportError> No module named 'httplib' (error at url.py:*) (glob) | |
97 | hgext/fetch.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) |
|
96 | hgext/fetch.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) | |
98 | hgext/fsmonitor/watchmanclient.py: error importing module: <SystemError> Parent module 'hgext.fsmonitor' not loaded, cannot perform relative import (line *) (glob) |
|
97 | hgext/fsmonitor/watchmanclient.py: error importing module: <SystemError> Parent module 'hgext.fsmonitor' not loaded, cannot perform relative import (line *) (glob) | |
99 | hgext/gpg.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) |
|
98 | hgext/gpg.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) | |
100 | hgext/graphlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
99 | hgext/graphlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
101 | hgext/hgcia.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
100 | hgext/hgcia.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
102 | hgext/hgk.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
101 | hgext/hgk.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
103 | hgext/histedit.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
102 | hgext/histedit.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
104 | hgext/keyword.py: error importing: <ImportError> No module named 'BaseHTTPServer' (error at common.py:*) (glob) |
|
103 | hgext/keyword.py: error importing: <ImportError> No module named 'BaseHTTPServer' (error at common.py:*) (glob) | |
105 | hgext/largefiles/basestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
104 | hgext/largefiles/basestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
106 | hgext/largefiles/lfcommands.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
105 | hgext/largefiles/lfcommands.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
107 | hgext/largefiles/lfutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
106 | hgext/largefiles/lfutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
108 | hgext/largefiles/localstore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob) |
|
107 | hgext/largefiles/localstore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob) | |
109 | hgext/largefiles/overrides.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
108 | hgext/largefiles/overrides.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
110 | hgext/largefiles/proto.py: error importing: <ImportError> No module named 'httplib' (error at httppeer.py:*) (glob) |
|
109 | hgext/largefiles/proto.py: error importing: <ImportError> No module named 'httplib' (error at httppeer.py:*) (glob) | |
111 | hgext/largefiles/remotestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob) |
|
110 | hgext/largefiles/remotestore.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob) | |
112 | hgext/largefiles/reposetup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
111 | hgext/largefiles/reposetup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
113 | hgext/largefiles/uisetup.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob) |
|
112 | hgext/largefiles/uisetup.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob) | |
114 | hgext/largefiles/wirestore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob) |
|
113 | hgext/largefiles/wirestore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob) | |
115 | hgext/mq.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) |
|
114 | hgext/mq.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob) | |
116 | hgext/notify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
115 | hgext/notify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
117 | hgext/pager.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
116 | hgext/pager.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
118 | hgext/patchbomb.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
117 | hgext/patchbomb.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
119 | hgext/purge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
118 | hgext/purge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
120 | hgext/rebase.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
119 | hgext/rebase.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
121 | hgext/record.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
120 | hgext/record.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
122 | hgext/relink.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
121 | hgext/relink.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
123 | hgext/schemes.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
122 | hgext/schemes.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
124 | hgext/share.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
123 | hgext/share.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
125 | hgext/shelve.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
124 | hgext/shelve.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
126 | hgext/strip.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
125 | hgext/strip.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
127 | hgext/transplant.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
126 | hgext/transplant.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
128 | mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
127 | mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
129 | mercurial/branchmap.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
128 | mercurial/branchmap.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
130 | mercurial/bundle*.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
129 | mercurial/bundle*.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
131 | mercurial/bundlerepo.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
130 | mercurial/bundlerepo.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
132 | mercurial/changegroup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
131 | mercurial/changegroup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
133 | mercurial/changelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
132 | mercurial/changelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
134 | mercurial/cmdutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
133 | mercurial/cmdutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
135 | mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
134 | mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
136 | mercurial/commandserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob) |
|
135 | mercurial/commandserver.py: error importing module: <ImportError> No module named 'SocketServer' (line *) (glob) | |
137 | mercurial/context.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
136 | mercurial/context.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
138 | mercurial/copies.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
137 | mercurial/copies.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
139 | mercurial/crecord.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
138 | mercurial/crecord.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
140 | mercurial/dirstate.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
139 | mercurial/dirstate.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
141 | mercurial/discovery.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
140 | mercurial/discovery.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
142 | mercurial/dispatch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
141 | mercurial/dispatch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
143 | mercurial/exchange.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
142 | mercurial/exchange.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
144 | mercurial/extensions.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
143 | mercurial/extensions.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
145 | mercurial/filelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
144 | mercurial/filelog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
146 | mercurial/filemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
145 | mercurial/filemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
147 | mercurial/fileset.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
146 | mercurial/fileset.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
148 | mercurial/formatter.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) |
|
147 | mercurial/formatter.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob) | |
149 | mercurial/graphmod.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
148 | mercurial/graphmod.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
150 | mercurial/help.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
149 | mercurial/help.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
151 | mercurial/hg.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) |
|
150 | mercurial/hg.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at bundlerepo.py:*) (glob) | |
152 | mercurial/hgweb/common.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob) |
|
151 | mercurial/hgweb/common.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob) | |
153 | mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
152 | mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
154 | mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
153 | mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
155 | mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
154 | mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
156 | mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
155 | mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
157 | mercurial/hgweb/server.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob) |
|
156 | mercurial/hgweb/server.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line *) (glob) | |
158 | mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
157 | mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
159 | mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
158 | mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
160 | mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) |
|
159 | mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob) | |
161 | mercurial/hook.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
160 | mercurial/hook.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
162 | mercurial/httpclient/_readers.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) |
|
161 | mercurial/httpclient/_readers.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) | |
163 | mercurial/httpconnection.py: error importing: <ImportError> No module named 'httplib' (error at __init__.py:*) (glob) |
|
162 | mercurial/httpconnection.py: error importing: <ImportError> No module named 'httplib' (error at __init__.py:*) (glob) | |
164 | mercurial/httppeer.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) |
|
163 | mercurial/httppeer.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) | |
165 | mercurial/keepalive.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) |
|
164 | mercurial/keepalive.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) | |
166 | mercurial/localrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
165 | mercurial/localrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
167 | mercurial/mail.py: error importing module: <AttributeError> module 'email' has no attribute 'Header' (line *) (glob) |
|
166 | mercurial/mail.py: error importing module: <AttributeError> module 'email' has no attribute 'Header' (line *) (glob) | |
168 | mercurial/manifest.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
167 | mercurial/manifest.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
169 | mercurial/merge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
168 | mercurial/merge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
170 | mercurial/namespaces.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
169 | mercurial/namespaces.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
171 | mercurial/patch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
170 | mercurial/patch.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
172 | mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob) |
|
171 | mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob) | |
173 | mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob) |
|
172 | mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob) | |
174 | mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
173 | mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
175 | mercurial/revlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
174 | mercurial/revlog.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
176 | mercurial/revset.py: error importing module: <AttributeError> 'dict' object has no attribute 'iteritems' (line *) (glob) |
|
175 | mercurial/revset.py: error importing module: <AttributeError> 'dict' object has no attribute 'iteritems' (line *) (glob) | |
177 | mercurial/scmutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
176 | mercurial/scmutil.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
178 | mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) |
|
177 | mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) | |
179 | mercurial/simplemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
178 | mercurial/simplemerge.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
180 | mercurial/sshpeer.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob) |
|
179 | mercurial/sshpeer.py: error importing: <SyntaxError> invalid syntax (bundle*.py, line *) (error at wireproto.py:*) (glob) | |
181 | mercurial/sshserver.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
180 | mercurial/sshserver.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
182 | mercurial/statichttprepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
181 | mercurial/statichttprepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
183 | mercurial/store.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
182 | mercurial/store.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
184 | mercurial/streamclone.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
183 | mercurial/streamclone.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
185 | mercurial/subrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
184 | mercurial/subrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
186 | mercurial/templatefilters.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
185 | mercurial/templatefilters.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
187 | mercurial/templatekw.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
186 | mercurial/templatekw.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
188 | mercurial/templater.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
187 | mercurial/templater.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
189 | mercurial/ui.py: error importing: <ImportError> No module named 'cPickle' (error at formatter.py:*) (glob) |
|
188 | mercurial/ui.py: error importing: <ImportError> No module named 'cPickle' (error at formatter.py:*) (glob) | |
190 | mercurial/unionrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
189 | mercurial/unionrepo.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
191 | mercurial/url.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) |
|
190 | mercurial/url.py: error importing module: <ImportError> No module named 'httplib' (line *) (glob) | |
192 | mercurial/verify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) |
|
191 | mercurial/verify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) | |
193 | mercurial/win*.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob) |
|
192 | mercurial/win*.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob) | |
194 | mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) |
|
193 | mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) | |
195 | mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) |
|
194 | mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob) | |
196 | tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
195 | tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
197 | tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
196 | tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
198 | tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
197 | tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
199 | tests/test-trusted.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) |
|
198 | tests/test-trusted.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) | |
200 |
|
199 | |||
201 | #endif |
|
200 | #endif |
@@ -1,354 +1,360 b'' | |||||
1 | # Copyright (C) 2004, 2005 Canonical Ltd |
|
1 | # Copyright (C) 2004, 2005 Canonical Ltd | |
2 | # |
|
2 | # | |
3 | # This program is free software; you can redistribute it and/or modify |
|
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by |
|
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 2 of the License, or |
|
5 | # the Free Software Foundation; either version 2 of the License, or | |
6 | # (at your option) any later version. |
|
6 | # (at your option) any later version. | |
7 | # |
|
7 | # | |
8 | # This program is distributed in the hope that it will be useful, |
|
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. |
|
11 | # GNU General Public License for more details. | |
12 | # |
|
12 | # | |
13 | # You should have received a copy of the GNU General Public License |
|
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program; if not, see <http://www.gnu.org/licenses/>. |
|
14 | # along with this program; if not, see <http://www.gnu.org/licenses/>. | |
15 |
|
15 | |||
|
16 | from __future__ import absolute_import | |||
|
17 | ||||
16 | import unittest |
|
18 | import unittest | |
17 | from unittest import TestCase |
|
19 | from mercurial import ( | |
18 | from mercurial import util, simplemerge, error |
|
20 | error, | |
|
21 | simplemerge, | |||
|
22 | util, | |||
|
23 | ) | |||
19 |
|
24 | |||
|
25 | TestCase = unittest.TestCase | |||
20 | # bzr compatible interface, for the tests |
|
26 | # bzr compatible interface, for the tests | |
21 | class Merge3(simplemerge.Merge3Text): |
|
27 | class Merge3(simplemerge.Merge3Text): | |
22 | """3-way merge of texts. |
|
28 | """3-way merge of texts. | |
23 |
|
29 | |||
24 | Given BASE, OTHER, THIS, tries to produce a combined text |
|
30 | Given BASE, OTHER, THIS, tries to produce a combined text | |
25 | incorporating the changes from both BASE->OTHER and BASE->THIS. |
|
31 | incorporating the changes from both BASE->OTHER and BASE->THIS. | |
26 | All three will typically be sequences of lines.""" |
|
32 | All three will typically be sequences of lines.""" | |
27 | def __init__(self, base, a, b): |
|
33 | def __init__(self, base, a, b): | |
28 | basetext = '\n'.join([i.strip('\n') for i in base] + ['']) |
|
34 | basetext = '\n'.join([i.strip('\n') for i in base] + ['']) | |
29 | atext = '\n'.join([i.strip('\n') for i in a] + ['']) |
|
35 | atext = '\n'.join([i.strip('\n') for i in a] + ['']) | |
30 | btext = '\n'.join([i.strip('\n') for i in b] + ['']) |
|
36 | btext = '\n'.join([i.strip('\n') for i in b] + ['']) | |
31 | if util.binary(basetext) or util.binary(atext) or util.binary(btext): |
|
37 | if util.binary(basetext) or util.binary(atext) or util.binary(btext): | |
32 | raise error.Abort("don't know how to merge binary files") |
|
38 | raise error.Abort("don't know how to merge binary files") | |
33 | simplemerge.Merge3Text.__init__(self, basetext, atext, btext, |
|
39 | simplemerge.Merge3Text.__init__(self, basetext, atext, btext, | |
34 | base, a, b) |
|
40 | base, a, b) | |
35 |
|
41 | |||
36 | CantReprocessAndShowBase = simplemerge.CantReprocessAndShowBase |
|
42 | CantReprocessAndShowBase = simplemerge.CantReprocessAndShowBase | |
37 |
|
43 | |||
38 | def split_lines(t): |
|
44 | def split_lines(t): | |
39 | return util.stringio(t).readlines() |
|
45 | return util.stringio(t).readlines() | |
40 |
|
46 | |||
41 | ############################################################ |
|
47 | ############################################################ | |
42 | # test case data from the gnu diffutils manual |
|
48 | # test case data from the gnu diffutils manual | |
43 | # common base |
|
49 | # common base | |
44 | TZU = split_lines(""" The Nameless is the origin of Heaven and Earth; |
|
50 | TZU = split_lines(""" The Nameless is the origin of Heaven and Earth; | |
45 | The named is the mother of all things. |
|
51 | The named is the mother of all things. | |
46 |
|
52 | |||
47 | Therefore let there always be non-being, |
|
53 | Therefore let there always be non-being, | |
48 | so we may see their subtlety, |
|
54 | so we may see their subtlety, | |
49 | And let there always be being, |
|
55 | And let there always be being, | |
50 | so we may see their outcome. |
|
56 | so we may see their outcome. | |
51 | The two are the same, |
|
57 | The two are the same, | |
52 | But after they are produced, |
|
58 | But after they are produced, | |
53 | they have different names. |
|
59 | they have different names. | |
54 | They both may be called deep and profound. |
|
60 | They both may be called deep and profound. | |
55 | Deeper and more profound, |
|
61 | Deeper and more profound, | |
56 | The door of all subtleties! |
|
62 | The door of all subtleties! | |
57 | """) |
|
63 | """) | |
58 |
|
64 | |||
59 | LAO = split_lines(""" The Way that can be told of is not the eternal Way; |
|
65 | LAO = split_lines(""" The Way that can be told of is not the eternal Way; | |
60 | The name that can be named is not the eternal name. |
|
66 | The name that can be named is not the eternal name. | |
61 | The Nameless is the origin of Heaven and Earth; |
|
67 | The Nameless is the origin of Heaven and Earth; | |
62 | The Named is the mother of all things. |
|
68 | The Named is the mother of all things. | |
63 | Therefore let there always be non-being, |
|
69 | Therefore let there always be non-being, | |
64 | so we may see their subtlety, |
|
70 | so we may see their subtlety, | |
65 | And let there always be being, |
|
71 | And let there always be being, | |
66 | so we may see their outcome. |
|
72 | so we may see their outcome. | |
67 | The two are the same, |
|
73 | The two are the same, | |
68 | But after they are produced, |
|
74 | But after they are produced, | |
69 | they have different names. |
|
75 | they have different names. | |
70 | """) |
|
76 | """) | |
71 |
|
77 | |||
72 |
|
78 | |||
73 | TAO = split_lines(""" The Way that can be told of is not the eternal Way; |
|
79 | TAO = split_lines(""" The Way that can be told of is not the eternal Way; | |
74 | The name that can be named is not the eternal name. |
|
80 | The name that can be named is not the eternal name. | |
75 | The Nameless is the origin of Heaven and Earth; |
|
81 | The Nameless is the origin of Heaven and Earth; | |
76 | The named is the mother of all things. |
|
82 | The named is the mother of all things. | |
77 |
|
83 | |||
78 | Therefore let there always be non-being, |
|
84 | Therefore let there always be non-being, | |
79 | so we may see their subtlety, |
|
85 | so we may see their subtlety, | |
80 | And let there always be being, |
|
86 | And let there always be being, | |
81 | so we may see their result. |
|
87 | so we may see their result. | |
82 | The two are the same, |
|
88 | The two are the same, | |
83 | But after they are produced, |
|
89 | But after they are produced, | |
84 | they have different names. |
|
90 | they have different names. | |
85 |
|
91 | |||
86 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan |
|
92 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan | |
87 |
|
93 | |||
88 | """) |
|
94 | """) | |
89 |
|
95 | |||
90 | MERGED_RESULT = split_lines("""\ |
|
96 | MERGED_RESULT = split_lines("""\ | |
91 | The Way that can be told of is not the eternal Way; |
|
97 | The Way that can be told of is not the eternal Way; | |
92 | The name that can be named is not the eternal name. |
|
98 | The name that can be named is not the eternal name. | |
93 | The Nameless is the origin of Heaven and Earth; |
|
99 | The Nameless is the origin of Heaven and Earth; | |
94 | The Named is the mother of all things. |
|
100 | The Named is the mother of all things. | |
95 | Therefore let there always be non-being, |
|
101 | Therefore let there always be non-being, | |
96 | so we may see their subtlety, |
|
102 | so we may see their subtlety, | |
97 | And let there always be being, |
|
103 | And let there always be being, | |
98 | so we may see their result. |
|
104 | so we may see their result. | |
99 | The two are the same, |
|
105 | The two are the same, | |
100 | But after they are produced, |
|
106 | But after they are produced, | |
101 | they have different names. |
|
107 | they have different names. | |
102 | <<<<<<< LAO |
|
108 | <<<<<<< LAO | |
103 | ======= |
|
109 | ======= | |
104 |
|
110 | |||
105 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan |
|
111 | -- The Way of Lao-Tzu, tr. Wing-tsit Chan | |
106 |
|
112 | |||
107 | >>>>>>> TAO |
|
113 | >>>>>>> TAO | |
108 | """) |
|
114 | """) | |
109 |
|
115 | |||
110 | class TestMerge3(TestCase): |
|
116 | class TestMerge3(TestCase): | |
111 | def log(self, msg): |
|
117 | def log(self, msg): | |
112 | pass |
|
118 | pass | |
113 |
|
119 | |||
114 | def test_no_changes(self): |
|
120 | def test_no_changes(self): | |
115 | """No conflicts because nothing changed""" |
|
121 | """No conflicts because nothing changed""" | |
116 | m3 = Merge3(['aaa', 'bbb'], |
|
122 | m3 = Merge3(['aaa', 'bbb'], | |
117 | ['aaa', 'bbb'], |
|
123 | ['aaa', 'bbb'], | |
118 | ['aaa', 'bbb']) |
|
124 | ['aaa', 'bbb']) | |
119 |
|
125 | |||
120 | self.assertEquals(m3.find_unconflicted(), |
|
126 | self.assertEquals(m3.find_unconflicted(), | |
121 | [(0, 2)]) |
|
127 | [(0, 2)]) | |
122 |
|
128 | |||
123 | self.assertEquals(list(m3.find_sync_regions()), |
|
129 | self.assertEquals(list(m3.find_sync_regions()), | |
124 | [(0, 2, |
|
130 | [(0, 2, | |
125 | 0, 2, |
|
131 | 0, 2, | |
126 | 0, 2), |
|
132 | 0, 2), | |
127 | (2, 2, 2, 2, 2, 2)]) |
|
133 | (2, 2, 2, 2, 2, 2)]) | |
128 |
|
134 | |||
129 | self.assertEquals(list(m3.merge_regions()), |
|
135 | self.assertEquals(list(m3.merge_regions()), | |
130 | [('unchanged', 0, 2)]) |
|
136 | [('unchanged', 0, 2)]) | |
131 |
|
137 | |||
132 | self.assertEquals(list(m3.merge_groups()), |
|
138 | self.assertEquals(list(m3.merge_groups()), | |
133 | [('unchanged', ['aaa', 'bbb'])]) |
|
139 | [('unchanged', ['aaa', 'bbb'])]) | |
134 |
|
140 | |||
135 | def test_front_insert(self): |
|
141 | def test_front_insert(self): | |
136 | m3 = Merge3(['zz'], |
|
142 | m3 = Merge3(['zz'], | |
137 | ['aaa', 'bbb', 'zz'], |
|
143 | ['aaa', 'bbb', 'zz'], | |
138 | ['zz']) |
|
144 | ['zz']) | |
139 |
|
145 | |||
140 | # todo: should use a sentinel at end as from get_matching_blocks |
|
146 | # todo: should use a sentinel at end as from get_matching_blocks | |
141 | # to match without zz |
|
147 | # to match without zz | |
142 | self.assertEquals(list(m3.find_sync_regions()), |
|
148 | self.assertEquals(list(m3.find_sync_regions()), | |
143 | [(0, 1, 2, 3, 0, 1), |
|
149 | [(0, 1, 2, 3, 0, 1), | |
144 | (1, 1, 3, 3, 1, 1)]) |
|
150 | (1, 1, 3, 3, 1, 1)]) | |
145 |
|
151 | |||
146 | self.assertEquals(list(m3.merge_regions()), |
|
152 | self.assertEquals(list(m3.merge_regions()), | |
147 | [('a', 0, 2), |
|
153 | [('a', 0, 2), | |
148 | ('unchanged', 0, 1)]) |
|
154 | ('unchanged', 0, 1)]) | |
149 |
|
155 | |||
150 | self.assertEquals(list(m3.merge_groups()), |
|
156 | self.assertEquals(list(m3.merge_groups()), | |
151 | [('a', ['aaa', 'bbb']), |
|
157 | [('a', ['aaa', 'bbb']), | |
152 | ('unchanged', ['zz'])]) |
|
158 | ('unchanged', ['zz'])]) | |
153 |
|
159 | |||
154 | def test_null_insert(self): |
|
160 | def test_null_insert(self): | |
155 | m3 = Merge3([], |
|
161 | m3 = Merge3([], | |
156 | ['aaa', 'bbb'], |
|
162 | ['aaa', 'bbb'], | |
157 | []) |
|
163 | []) | |
158 | # todo: should use a sentinel at end as from get_matching_blocks |
|
164 | # todo: should use a sentinel at end as from get_matching_blocks | |
159 | # to match without zz |
|
165 | # to match without zz | |
160 | self.assertEquals(list(m3.find_sync_regions()), |
|
166 | self.assertEquals(list(m3.find_sync_regions()), | |
161 | [(0, 0, 2, 2, 0, 0)]) |
|
167 | [(0, 0, 2, 2, 0, 0)]) | |
162 |
|
168 | |||
163 | self.assertEquals(list(m3.merge_regions()), |
|
169 | self.assertEquals(list(m3.merge_regions()), | |
164 | [('a', 0, 2)]) |
|
170 | [('a', 0, 2)]) | |
165 |
|
171 | |||
166 | self.assertEquals(list(m3.merge_lines()), |
|
172 | self.assertEquals(list(m3.merge_lines()), | |
167 | ['aaa', 'bbb']) |
|
173 | ['aaa', 'bbb']) | |
168 |
|
174 | |||
169 | def test_no_conflicts(self): |
|
175 | def test_no_conflicts(self): | |
170 | """No conflicts because only one side changed""" |
|
176 | """No conflicts because only one side changed""" | |
171 | m3 = Merge3(['aaa', 'bbb'], |
|
177 | m3 = Merge3(['aaa', 'bbb'], | |
172 | ['aaa', '111', 'bbb'], |
|
178 | ['aaa', '111', 'bbb'], | |
173 | ['aaa', 'bbb']) |
|
179 | ['aaa', 'bbb']) | |
174 |
|
180 | |||
175 | self.assertEquals(m3.find_unconflicted(), |
|
181 | self.assertEquals(m3.find_unconflicted(), | |
176 | [(0, 1), (1, 2)]) |
|
182 | [(0, 1), (1, 2)]) | |
177 |
|
183 | |||
178 | self.assertEquals(list(m3.find_sync_regions()), |
|
184 | self.assertEquals(list(m3.find_sync_regions()), | |
179 | [(0, 1, 0, 1, 0, 1), |
|
185 | [(0, 1, 0, 1, 0, 1), | |
180 | (1, 2, 2, 3, 1, 2), |
|
186 | (1, 2, 2, 3, 1, 2), | |
181 | (2, 2, 3, 3, 2, 2)]) |
|
187 | (2, 2, 3, 3, 2, 2)]) | |
182 |
|
188 | |||
183 | self.assertEquals(list(m3.merge_regions()), |
|
189 | self.assertEquals(list(m3.merge_regions()), | |
184 | [('unchanged', 0, 1), |
|
190 | [('unchanged', 0, 1), | |
185 | ('a', 1, 2), |
|
191 | ('a', 1, 2), | |
186 | ('unchanged', 1, 2)]) |
|
192 | ('unchanged', 1, 2)]) | |
187 |
|
193 | |||
188 | def test_append_a(self): |
|
194 | def test_append_a(self): | |
189 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
195 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
190 | ['aaa\n', 'bbb\n', '222\n'], |
|
196 | ['aaa\n', 'bbb\n', '222\n'], | |
191 | ['aaa\n', 'bbb\n']) |
|
197 | ['aaa\n', 'bbb\n']) | |
192 |
|
198 | |||
193 | self.assertEquals(''.join(m3.merge_lines()), |
|
199 | self.assertEquals(''.join(m3.merge_lines()), | |
194 | 'aaa\nbbb\n222\n') |
|
200 | 'aaa\nbbb\n222\n') | |
195 |
|
201 | |||
196 | def test_append_b(self): |
|
202 | def test_append_b(self): | |
197 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
203 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
198 | ['aaa\n', 'bbb\n'], |
|
204 | ['aaa\n', 'bbb\n'], | |
199 | ['aaa\n', 'bbb\n', '222\n']) |
|
205 | ['aaa\n', 'bbb\n', '222\n']) | |
200 |
|
206 | |||
201 | self.assertEquals(''.join(m3.merge_lines()), |
|
207 | self.assertEquals(''.join(m3.merge_lines()), | |
202 | 'aaa\nbbb\n222\n') |
|
208 | 'aaa\nbbb\n222\n') | |
203 |
|
209 | |||
204 | def test_append_agreement(self): |
|
210 | def test_append_agreement(self): | |
205 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
211 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
206 | ['aaa\n', 'bbb\n', '222\n'], |
|
212 | ['aaa\n', 'bbb\n', '222\n'], | |
207 | ['aaa\n', 'bbb\n', '222\n']) |
|
213 | ['aaa\n', 'bbb\n', '222\n']) | |
208 |
|
214 | |||
209 | self.assertEquals(''.join(m3.merge_lines()), |
|
215 | self.assertEquals(''.join(m3.merge_lines()), | |
210 | 'aaa\nbbb\n222\n') |
|
216 | 'aaa\nbbb\n222\n') | |
211 |
|
217 | |||
212 | def test_append_clash(self): |
|
218 | def test_append_clash(self): | |
213 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
219 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
214 | ['aaa\n', 'bbb\n', '222\n'], |
|
220 | ['aaa\n', 'bbb\n', '222\n'], | |
215 | ['aaa\n', 'bbb\n', '333\n']) |
|
221 | ['aaa\n', 'bbb\n', '333\n']) | |
216 |
|
222 | |||
217 | ml = m3.merge_lines(name_a='a', |
|
223 | ml = m3.merge_lines(name_a='a', | |
218 | name_b='b', |
|
224 | name_b='b', | |
219 | start_marker='<<', |
|
225 | start_marker='<<', | |
220 | mid_marker='--', |
|
226 | mid_marker='--', | |
221 | end_marker='>>') |
|
227 | end_marker='>>') | |
222 | self.assertEquals(''.join(ml), |
|
228 | self.assertEquals(''.join(ml), | |
223 | 'aaa\n' |
|
229 | 'aaa\n' | |
224 | 'bbb\n' |
|
230 | 'bbb\n' | |
225 | '<< a\n' |
|
231 | '<< a\n' | |
226 | '222\n' |
|
232 | '222\n' | |
227 | '--\n' |
|
233 | '--\n' | |
228 | '333\n' |
|
234 | '333\n' | |
229 | '>> b\n' |
|
235 | '>> b\n' | |
230 | ) |
|
236 | ) | |
231 |
|
237 | |||
232 | def test_insert_agreement(self): |
|
238 | def test_insert_agreement(self): | |
233 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
239 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
234 | ['aaa\n', '222\n', 'bbb\n'], |
|
240 | ['aaa\n', '222\n', 'bbb\n'], | |
235 | ['aaa\n', '222\n', 'bbb\n']) |
|
241 | ['aaa\n', '222\n', 'bbb\n']) | |
236 |
|
242 | |||
237 | ml = m3.merge_lines(name_a='a', |
|
243 | ml = m3.merge_lines(name_a='a', | |
238 | name_b='b', |
|
244 | name_b='b', | |
239 | start_marker='<<', |
|
245 | start_marker='<<', | |
240 | mid_marker='--', |
|
246 | mid_marker='--', | |
241 | end_marker='>>') |
|
247 | end_marker='>>') | |
242 | self.assertEquals(''.join(ml), 'aaa\n222\nbbb\n') |
|
248 | self.assertEquals(''.join(ml), 'aaa\n222\nbbb\n') | |
243 |
|
249 | |||
244 |
|
250 | |||
245 | def test_insert_clash(self): |
|
251 | def test_insert_clash(self): | |
246 | """Both try to insert lines in the same place.""" |
|
252 | """Both try to insert lines in the same place.""" | |
247 | m3 = Merge3(['aaa\n', 'bbb\n'], |
|
253 | m3 = Merge3(['aaa\n', 'bbb\n'], | |
248 | ['aaa\n', '111\n', 'bbb\n'], |
|
254 | ['aaa\n', '111\n', 'bbb\n'], | |
249 | ['aaa\n', '222\n', 'bbb\n']) |
|
255 | ['aaa\n', '222\n', 'bbb\n']) | |
250 |
|
256 | |||
251 | self.assertEquals(m3.find_unconflicted(), |
|
257 | self.assertEquals(m3.find_unconflicted(), | |
252 | [(0, 1), (1, 2)]) |
|
258 | [(0, 1), (1, 2)]) | |
253 |
|
259 | |||
254 | self.assertEquals(list(m3.find_sync_regions()), |
|
260 | self.assertEquals(list(m3.find_sync_regions()), | |
255 | [(0, 1, 0, 1, 0, 1), |
|
261 | [(0, 1, 0, 1, 0, 1), | |
256 | (1, 2, 2, 3, 2, 3), |
|
262 | (1, 2, 2, 3, 2, 3), | |
257 | (2, 2, 3, 3, 3, 3)]) |
|
263 | (2, 2, 3, 3, 3, 3)]) | |
258 |
|
264 | |||
259 | self.assertEquals(list(m3.merge_regions()), |
|
265 | self.assertEquals(list(m3.merge_regions()), | |
260 | [('unchanged', 0, 1), |
|
266 | [('unchanged', 0, 1), | |
261 | ('conflict', 1, 1, 1, 2, 1, 2), |
|
267 | ('conflict', 1, 1, 1, 2, 1, 2), | |
262 | ('unchanged', 1, 2)]) |
|
268 | ('unchanged', 1, 2)]) | |
263 |
|
269 | |||
264 | self.assertEquals(list(m3.merge_groups()), |
|
270 | self.assertEquals(list(m3.merge_groups()), | |
265 | [('unchanged', ['aaa\n']), |
|
271 | [('unchanged', ['aaa\n']), | |
266 | ('conflict', [], ['111\n'], ['222\n']), |
|
272 | ('conflict', [], ['111\n'], ['222\n']), | |
267 | ('unchanged', ['bbb\n']), |
|
273 | ('unchanged', ['bbb\n']), | |
268 | ]) |
|
274 | ]) | |
269 |
|
275 | |||
270 | ml = m3.merge_lines(name_a='a', |
|
276 | ml = m3.merge_lines(name_a='a', | |
271 | name_b='b', |
|
277 | name_b='b', | |
272 | start_marker='<<', |
|
278 | start_marker='<<', | |
273 | mid_marker='--', |
|
279 | mid_marker='--', | |
274 | end_marker='>>') |
|
280 | end_marker='>>') | |
275 | self.assertEquals(''.join(ml), |
|
281 | self.assertEquals(''.join(ml), | |
276 | '''aaa |
|
282 | '''aaa | |
277 | << a |
|
283 | << a | |
278 | 111 |
|
284 | 111 | |
279 | -- |
|
285 | -- | |
280 | 222 |
|
286 | 222 | |
281 | >> b |
|
287 | >> b | |
282 | bbb |
|
288 | bbb | |
283 | ''') |
|
289 | ''') | |
284 |
|
290 | |||
285 | def test_replace_clash(self): |
|
291 | def test_replace_clash(self): | |
286 | """Both try to insert lines in the same place.""" |
|
292 | """Both try to insert lines in the same place.""" | |
287 | m3 = Merge3(['aaa', '000', 'bbb'], |
|
293 | m3 = Merge3(['aaa', '000', 'bbb'], | |
288 | ['aaa', '111', 'bbb'], |
|
294 | ['aaa', '111', 'bbb'], | |
289 | ['aaa', '222', 'bbb']) |
|
295 | ['aaa', '222', 'bbb']) | |
290 |
|
296 | |||
291 | self.assertEquals(m3.find_unconflicted(), |
|
297 | self.assertEquals(m3.find_unconflicted(), | |
292 | [(0, 1), (2, 3)]) |
|
298 | [(0, 1), (2, 3)]) | |
293 |
|
299 | |||
294 | self.assertEquals(list(m3.find_sync_regions()), |
|
300 | self.assertEquals(list(m3.find_sync_regions()), | |
295 | [(0, 1, 0, 1, 0, 1), |
|
301 | [(0, 1, 0, 1, 0, 1), | |
296 | (2, 3, 2, 3, 2, 3), |
|
302 | (2, 3, 2, 3, 2, 3), | |
297 | (3, 3, 3, 3, 3, 3)]) |
|
303 | (3, 3, 3, 3, 3, 3)]) | |
298 |
|
304 | |||
299 | def test_replace_multi(self): |
|
305 | def test_replace_multi(self): | |
300 | """Replacement with regions of different size.""" |
|
306 | """Replacement with regions of different size.""" | |
301 | m3 = Merge3(['aaa', '000', '000', 'bbb'], |
|
307 | m3 = Merge3(['aaa', '000', '000', 'bbb'], | |
302 | ['aaa', '111', '111', '111', 'bbb'], |
|
308 | ['aaa', '111', '111', '111', 'bbb'], | |
303 | ['aaa', '222', '222', '222', '222', 'bbb']) |
|
309 | ['aaa', '222', '222', '222', '222', 'bbb']) | |
304 |
|
310 | |||
305 | self.assertEquals(m3.find_unconflicted(), |
|
311 | self.assertEquals(m3.find_unconflicted(), | |
306 | [(0, 1), (3, 4)]) |
|
312 | [(0, 1), (3, 4)]) | |
307 |
|
313 | |||
308 |
|
314 | |||
309 | self.assertEquals(list(m3.find_sync_regions()), |
|
315 | self.assertEquals(list(m3.find_sync_regions()), | |
310 | [(0, 1, 0, 1, 0, 1), |
|
316 | [(0, 1, 0, 1, 0, 1), | |
311 | (3, 4, 4, 5, 5, 6), |
|
317 | (3, 4, 4, 5, 5, 6), | |
312 | (4, 4, 5, 5, 6, 6)]) |
|
318 | (4, 4, 5, 5, 6, 6)]) | |
313 |
|
319 | |||
314 | def test_merge_poem(self): |
|
320 | def test_merge_poem(self): | |
315 | """Test case from diff3 manual""" |
|
321 | """Test case from diff3 manual""" | |
316 | m3 = Merge3(TZU, LAO, TAO) |
|
322 | m3 = Merge3(TZU, LAO, TAO) | |
317 | ml = list(m3.merge_lines('LAO', 'TAO')) |
|
323 | ml = list(m3.merge_lines('LAO', 'TAO')) | |
318 | self.log('merge result:') |
|
324 | self.log('merge result:') | |
319 | self.log(''.join(ml)) |
|
325 | self.log(''.join(ml)) | |
320 | self.assertEquals(ml, MERGED_RESULT) |
|
326 | self.assertEquals(ml, MERGED_RESULT) | |
321 |
|
327 | |||
322 | def test_binary(self): |
|
328 | def test_binary(self): | |
323 | self.assertRaises(error.Abort, Merge3, ['\x00'], ['a'], ['b']) |
|
329 | self.assertRaises(error.Abort, Merge3, ['\x00'], ['a'], ['b']) | |
324 |
|
330 | |||
325 | def test_dos_text(self): |
|
331 | def test_dos_text(self): | |
326 | base_text = 'a\r\n' |
|
332 | base_text = 'a\r\n' | |
327 | this_text = 'b\r\n' |
|
333 | this_text = 'b\r\n' | |
328 | other_text = 'c\r\n' |
|
334 | other_text = 'c\r\n' | |
329 | m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True), |
|
335 | m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True), | |
330 | this_text.splitlines(True)) |
|
336 | this_text.splitlines(True)) | |
331 | m_lines = m3.merge_lines('OTHER', 'THIS') |
|
337 | m_lines = m3.merge_lines('OTHER', 'THIS') | |
332 | self.assertEqual('<<<<<<< OTHER\r\nc\r\n=======\r\nb\r\n' |
|
338 | self.assertEqual('<<<<<<< OTHER\r\nc\r\n=======\r\nb\r\n' | |
333 | '>>>>>>> THIS\r\n'.splitlines(True), list(m_lines)) |
|
339 | '>>>>>>> THIS\r\n'.splitlines(True), list(m_lines)) | |
334 |
|
340 | |||
335 | def test_mac_text(self): |
|
341 | def test_mac_text(self): | |
336 | base_text = 'a\r' |
|
342 | base_text = 'a\r' | |
337 | this_text = 'b\r' |
|
343 | this_text = 'b\r' | |
338 | other_text = 'c\r' |
|
344 | other_text = 'c\r' | |
339 | m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True), |
|
345 | m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True), | |
340 | this_text.splitlines(True)) |
|
346 | this_text.splitlines(True)) | |
341 | m_lines = m3.merge_lines('OTHER', 'THIS') |
|
347 | m_lines = m3.merge_lines('OTHER', 'THIS') | |
342 | self.assertEqual('<<<<<<< OTHER\rc\r=======\rb\r' |
|
348 | self.assertEqual('<<<<<<< OTHER\rc\r=======\rb\r' | |
343 | '>>>>>>> THIS\r'.splitlines(True), list(m_lines)) |
|
349 | '>>>>>>> THIS\r'.splitlines(True), list(m_lines)) | |
344 |
|
350 | |||
345 | if __name__ == '__main__': |
|
351 | if __name__ == '__main__': | |
346 | # hide the timer |
|
352 | # hide the timer | |
347 | import time |
|
353 | import time | |
348 | orig = time.time |
|
354 | orig = time.time | |
349 | try: |
|
355 | try: | |
350 | time.time = lambda: 0 |
|
356 | time.time = lambda: 0 | |
351 | unittest.main() |
|
357 | unittest.main() | |
352 | finally: |
|
358 | finally: | |
353 | time.time = orig |
|
359 | time.time = orig | |
354 |
|
360 |
General Comments 0
You need to be logged in to leave comments.
Login now