[PATCH 3 of 5] namespaces: add test for log

Sean Farley sean.michael.farley at gmail.com
Wed Jan 7 18:15:54 CST 2015


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1413946163 25200
#      Tue Oct 21 19:49:23 2014 -0700
# Node ID 267ff85247daf9784461688616301315d82a2792
# Parent  541de5f46e66ee9f5941d576ab13665901d5fd95
namespaces: add test for log

Now that we have enough features in the namespaces api, we add a test for it.

diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1557,11 +1557,38 @@ issue3772: hg log -r :null showing revis
   $ hg log -r null:null
   changeset:   -1:000000000000
   user:        
   date:        Thu Jan 01 00:00:00 1970 +0000
   
+Check that adding an arbitrary name shows up in log automatically
 
+  $ cat > ../names.py <<EOF
+  > """A small extension to test adding arbitrary names to a repo"""
+  > foo = {
+  >    'foo': 'ebL\xd9\x07\n\x03_\xa7\x19\x1aT\xf2\xb8\xaf9\xf1k\x0c\x08'
+  > }
+  > 
+  > from mercurial.namespaces import namespace
+  > 
+  > def reposetup(ui, repo):
+  >     ns = namespace("bars", "bar", "bar",
+  >                    lambda r: foo.keys(),
+  >                    lambda r, name: foo.get(name),
+  >                    lambda r, node: [name for name, n
+  >                                     in foo.iteritems()
+  >                                     if n == node])
+  >     repo.names.addnamespace(ns)
+  > EOF
+
+  $ hg --config extensions.names=../names.py log -r 0
+  changeset:   0:65624cd9070a
+  tag:         tip
+  bar:         foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a bunch of weird directories
+  
   $ cd ..
 
 hg log -f dir across branches
 
   $ hg init acrossbranches


More information about the Mercurial-devel mailing list