Patchwork [3,of,5] namespaces: add test for log

login
register
mail settings
Submitter Sean Farley
Date Jan. 8, 2015, 12:15 a.m.
Message ID <267ff85247daf9784461.1420676154@laptop.local>
Download mbox | patch
Permalink /patch/7370/
State Accepted
Headers show

Comments

Sean Farley - Jan. 8, 2015, 12:15 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@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.

Patch

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