##// END OF EJS Templates
test-archive: gracefully handle HTTPErrors on get-with-headers...
Angel Ezquerra -
r18770:dcb6a99e default
parent child Browse files
Show More
@@ -69,10 +69,18 b' invalid arch type should give 404'
69 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
69 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
70 > except ImportError:
70 > except ImportError:
71 > pass
71 > pass
72 > node, archive = sys.argv[1:]
72 > if len(sys.argv) <= 3:
73 > f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
73 > node, archive = sys.argv[1:]
74 > % (os.environ['HGPORT'], node, archive))
74 > requeststr = 'cmd=archive;node=%s;type=%s' % (node, archive)
75 > sys.stdout.write(f.read())
75 > else:
76 > node, archive, file = sys.argv[1:]
77 > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
78 > try:
79 > f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
80 > % (os.environ['HGPORT'], requeststr))
81 > sys.stdout.write(f.read())
82 > except urllib2.HTTPError, e:
83 > sys.stderr.write(str(e) + '\n')
76 > EOF
84 > EOF
77 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
85 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
78 test-archive-2c0277f05ed4/.hg_archival.txt
86 test-archive-2c0277f05ed4/.hg_archival.txt
General Comments 0
You need to be logged in to leave comments. Login now