changeset 5160:a04694e08775

merge with crew-stable
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 11 Aug 2007 13:35:25 +0200
parents d84329a11fdd (current diff) f3f033def181 (diff)
children 4ed58fe4fe13
files
diffstat 7 files changed, 63 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fancyopts.py	Fri Aug 10 10:51:47 2007 -0700
+++ b/mercurial/fancyopts.py	Sat Aug 11 13:35:25 2007 +0200
@@ -9,7 +9,10 @@
     for s, l, d, c in options:
         pl = l.replace('-', '_')
         map['-'+s] = map['--'+l] = pl
-        state[pl] = d
+        if isinstance(d, list):
+            state[pl] = d[:]
+        else:
+            state[pl] = d
         dt[pl] = type(d)
         if (d is not None and d is not True and d is not False and
             not callable(d)):
--- a/tests/hghave	Fri Aug 10 10:51:47 2007 -0700
+++ b/tests/hghave	Sat Aug 11 13:35:25 2007 +0200
@@ -73,7 +73,7 @@
         negate = feature.startswith('no-')
         if negate:
             feature = feature[3:]
-        
+
         if feature not in checks:
             error('hghave: unknown feature: ' + feature)
             continue
@@ -82,7 +82,7 @@
         if not negate and not check():
             error('hghave: missing feature: ' + desc)
         elif negate and check():
-            error('hghave: unexpected feature: ' + desc)
+            error('hghave: system supports %s' % desc)
 
     if failures != 0:
         sys.exit(1)
--- a/tests/test-context.py	Fri Aug 10 10:51:47 2007 -0700
+++ b/tests/test-context.py	Sat Aug 11 13:35:25 2007 +0200
@@ -5,7 +5,6 @@
 
 repo = hg.repository(u, 'test1', create=1)
 os.chdir('test1')
-repo = hg.repository(u, '.') # FIXME: can't lock repo without doing this
 
 # create 'foo' with fixed time stamp
 f = file('foo', 'w')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dispatch.py	Sat Aug 11 13:35:25 2007 +0200
@@ -0,0 +1,32 @@
+import os
+from mercurial import commands
+
+def dispatch(cmd):
+    """Simple wrapper around commands.dispatch()
+
+    Prints command and result value, but does not handle quoting.
+    """
+    print "running: %s" % (cmd,)
+    result = commands.dispatch(cmd.split())
+    print "result: %r" % (result,)
+
+
+dispatch("init test1")
+os.chdir('test1')
+
+# create file 'foo', add and commit
+f = file('foo', 'wb')
+f.write('foo\n')
+f.close()
+dispatch("add foo")
+dispatch("commit -m commit1 -d 2000-01-01 foo")
+
+# append to file 'foo' and commit
+f = file('foo', 'ab')
+f.write('bar\n')
+f.close()
+dispatch("commit -m commit2 -d 2000-01-02 foo")
+
+# check 88803a69b24 (fancyopts modified command table)
+dispatch("log -r 0")
+dispatch("log -r tip")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dispatch.py.out	Sat Aug 11 13:35:25 2007 +0200
@@ -0,0 +1,23 @@
+running: init test1
+result: None
+running: add foo
+result: None
+running: commit -m commit1 -d 2000-01-01 foo
+result: None
+running: commit -m commit2 -d 2000-01-02 foo
+result: None
+running: log -r 0
+changeset:   0:0e4634943879
+user:        test
+date:        Sat Jan 01 00:00:00 2000 +0000
+summary:     commit1
+
+result: None
+running: log -r tip
+changeset:   1:45589e459b2e
+tag:         tip
+user:        test
+date:        Sun Jan 02 00:00:00 2000 +0000
+summary:     commit2
+
+result: None
--- a/tests/test-no-symlinks	Fri Aug 10 10:51:47 2007 -0700
+++ b/tests/test-no-symlinks	Sat Aug 11 13:35:25 2007 +0200
@@ -18,7 +18,7 @@
 echo % unbundle
 hg init t
 cd t
-hg pull "$TESTDIR/test-no-symlinks.hg"
+hg pull -q "$TESTDIR/test-no-symlinks.hg"
 hg update
 
 cat a.lnk && echo
@@ -44,4 +44,4 @@
 
 cat a.lnk && echo
 cat d/a2.lnk && echo
-cat b2.lnk && echo
\ No newline at end of file
+cat b2.lnk && echo
--- a/tests/test-no-symlinks.out	Fri Aug 10 10:51:47 2007 -0700
+++ b/tests/test-no-symlinks.out	Sat Aug 11 13:35:25 2007 +0200
@@ -1,11 +1,4 @@
 % unbundle
-pulling from C:\dev\mercurial\hg\hg-local-stable\tests/test-no-symlinks.hg
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 4 changes to 4 files
-(run 'hg update' to get a working copy)
 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
 a
 d/b