Mercurial > public > mercurial-scm > hg
comparison contrib/debugcmdserver.py @ 28353:cd03fbd5ab57
debugcmdserver: use absolute_import and print_function
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 06 Mar 2016 03:06:09 +0530 |
parents | e34106fa0dc3 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
28352:a92ee4d8a574 | 28353:cd03fbd5ab57 |
---|---|
5 # format to stdout. | 5 # format to stdout. |
6 # | 6 # |
7 # $ ./hg serve --cmds pipe | ./contrib/debugcmdserver.py - | 7 # $ ./hg serve --cmds pipe | ./contrib/debugcmdserver.py - |
8 # o, 52 -> 'capabilities: getencoding runcommand\nencoding: UTF-8' | 8 # o, 52 -> 'capabilities: getencoding runcommand\nencoding: UTF-8' |
9 | 9 |
10 import sys, struct | 10 from __future__ import absolute_import, print_function |
11 import struct | |
12 import sys | |
11 | 13 |
12 if len(sys.argv) != 2: | 14 if len(sys.argv) != 2: |
13 print 'usage: debugcmdserver.py FILE' | 15 print('usage: debugcmdserver.py FILE') |
14 sys.exit(1) | 16 sys.exit(1) |
15 | 17 |
16 outputfmt = '>cI' | 18 outputfmt = '>cI' |
17 outputfmtsize = struct.calcsize(outputfmt) | 19 outputfmtsize = struct.calcsize(outputfmt) |
18 | 20 |