summaryrefslogtreecommitdiff
path: root/sys/lib/python/mercurial/node.py
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/lib/python/mercurial/node.py
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/lib/python/mercurial/node.py')
-rw-r--r--sys/lib/python/mercurial/node.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/lib/python/mercurial/node.py b/sys/lib/python/mercurial/node.py
new file mode 100644
index 000000000..2a3be39c1
--- /dev/null
+++ b/sys/lib/python/mercurial/node.py
@@ -0,0 +1,18 @@
+# node.py - basic nodeid manipulation for mercurial
+#
+# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2, incorporated herein by reference.
+
+import binascii
+
+nullrev = -1
+nullid = "\0" * 20
+
+# This ugly style has a noticeable effect in manifest parsing
+hex = binascii.hexlify
+bin = binascii.unhexlify
+
+def short(node):
+ return hex(node[:6])