annotate tests/test-debugcomplete @ 4359:2e3c54fb79a3

actually port simplemerge to hg - use bdiff instead of patiencediff; this is a larger change, since bdiff works on 2 multi-line strings, while patiencediff works on 2 lists; - rename the main class from Merge3 to Merge3Text and add a Merge3 class that derives from Merge3Text. This new Merge3 class has the same interface from the original class, so that the tests still work; - Merge3 uses util.binary to detect binary data and raises util.Abort instead of a specific exception; - don't use the @decorator syntax, to keep python2.3 compatibility; - the test uses unittest, which likes to print how long it took to run. This obviously doesn't play too well with hg's test suite, so we override time.time to fool unittest; - one test has a different (but still valid) output because of the different diff algorithm used; - the TestCase class used by bzr has some extras to help debugging. test-merge3.py used 2 of them: - log method to log some data - assertEqualDiff method to ease viewing diffs of diffs We add a dummy log method and use regular assertEquals instead of assertEqualDiff. - make simplemerge executable and add "#!/usr/bin/env python" header
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 16 Apr 2007 20:17:39 -0300
parents 399c04369a1b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3292
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
1 #!/bin/sh
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
2
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
3 echo '% Show all commands except debug commands'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
4 hg debugcomplete
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
5
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
6 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
7 echo '% Show all commands that start with "a"'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
8 hg debugcomplete a
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
9
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
10 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
11 echo '% Do not show debug commands if there are other candidates'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
12 hg debugcomplete d
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
13
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
14 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
15 echo '% Show debug commands if there are no other candidates'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
16 hg debugcomplete debug
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
17
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
18 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
19 echo '% Do not show the alias of a debug command if there are other candidates'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
20 echo '% (this should hide rawcommit)'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
21 hg debugcomplete r
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
22
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
23 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
24 echo '% Show the alias of a debug command if there are no other candidates'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
25 hg debugcomplete rawc
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
26
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
27 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
28 echo '% Show the global options'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
29 hg debugcomplete --options | sort
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
30
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
31 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
32 echo '% Show the options for the "serve" command'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
33 hg debugcomplete --options serve | sort
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
34
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
35 echo
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
36 echo '% Show an error if we use --options with an ambiguous abbreviation'
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
37 hg debugcomplete --options s
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
38
399c04369a1b fix bash completion of debug commands; add test for debugcomplete
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
39 exit 0