comparison lib/redmine/scm/adapters/mercurial/redminehelper.py @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
comparison
equal deleted inserted replaced
1516:b450a9d58aed 1517:dffacf8a6908
14 I/O encoding: 14 I/O encoding:
15 15
16 :file path: urlencoded, raw string 16 :file path: urlencoded, raw string
17 :tag name: utf-8 17 :tag name: utf-8
18 :branch name: utf-8 18 :branch name: utf-8
19 :node: 12-digits (short) hex string 19 :node: hex string
20 20
21 Output example of rhsummary:: 21 Output example of rhsummary::
22 22
23 <?xml version="1.0"?> 23 <?xml version="1.0"?>
24 <rhsummary> 24 <rhsummary>
58 return len(repo) - 1 58 return len(repo) - 1
59 except TypeError: # Mercurial < 1.1 59 except TypeError: # Mercurial < 1.1
60 return repo.changelog.count() - 1 60 return repo.changelog.count() - 1
61 tipctx = repo.changectx(tiprev()) 61 tipctx = repo.changectx(tiprev())
62 ui.write('<tip revision="%d" node="%s"/>\n' 62 ui.write('<tip revision="%d" node="%s"/>\n'
63 % (tipctx.rev(), _x(node.short(tipctx.node())))) 63 % (tipctx.rev(), _x(node.hex(tipctx.node()))))
64 64
65 _SPECIAL_TAGS = ('tip',) 65 _SPECIAL_TAGS = ('tip',)
66 66
67 def _tags(ui, repo): 67 def _tags(ui, repo):
68 # see mercurial/commands.py:tags 68 # see mercurial/commands.py:tags
72 try: 72 try:
73 r = repo.changelog.rev(n) 73 r = repo.changelog.rev(n)
74 except error.LookupError: 74 except error.LookupError:
75 continue 75 continue
76 ui.write('<tag revision="%d" node="%s" name="%s"/>\n' 76 ui.write('<tag revision="%d" node="%s" name="%s"/>\n'
77 % (r, _x(node.short(n)), _x(t))) 77 % (r, _x(node.hex(n)), _x(t)))
78 78
79 def _branches(ui, repo): 79 def _branches(ui, repo):
80 # see mercurial/commands.py:branches 80 # see mercurial/commands.py:branches
81 def iterbranches(): 81 def iterbranches():
82 if getattr(repo, 'branchtags', None) is not None: 82 if getattr(repo, 'branchtags', None) is not None:
92 except TypeError: # Mercurial < 1.2 92 except TypeError: # Mercurial < 1.2
93 return repo.branchheads(branch) 93 return repo.branchheads(branch)
94 for t, n, r in sorted(iterbranches(), key=lambda e: e[2], reverse=True): 94 for t, n, r in sorted(iterbranches(), key=lambda e: e[2], reverse=True):
95 if repo.lookup(r) in branchheads(t): 95 if repo.lookup(r) in branchheads(t):
96 ui.write('<branch revision="%d" node="%s" name="%s"/>\n' 96 ui.write('<branch revision="%d" node="%s" name="%s"/>\n'
97 % (r, _x(node.short(n)), _x(t))) 97 % (r, _x(node.hex(n)), _x(t)))
98 98
99 def _manifest(ui, repo, path, rev): 99 def _manifest(ui, repo, path, rev):
100 ctx = repo.changectx(rev) 100 ctx = repo.changectx(rev)
101 ui.write('<manifest revision="%d" path="%s">\n' 101 ui.write('<manifest revision="%d" path="%s">\n'
102 % (ctx.rev(), _u(path))) 102 % (ctx.rev(), _u(path)))
117 else: 117 else:
118 fctx = repo.filectx(f, fileid=n) 118 fctx = repo.filectx(f, fileid=n)
119 tm, tzoffset = fctx.date() 119 tm, tzoffset = fctx.date()
120 ui.write('<file name="%s" revision="%d" node="%s" ' 120 ui.write('<file name="%s" revision="%d" node="%s" '
121 'time="%d" size="%d"/>\n' 121 'time="%d" size="%d"/>\n'
122 % (_u(name), fctx.rev(), _x(node.short(fctx.node())), 122 % (_u(name), fctx.rev(), _x(node.hex(fctx.node())),
123 tm, fctx.size(), )) 123 tm, fctx.size(), ))
124 124
125 ui.write('</manifest>\n') 125 ui.write('</manifest>\n')
126 126
127 def rhannotate(ui, repo, *pats, **opts): 127 def rhannotate(ui, repo, *pats, **opts):