OpenSource » Forked Projects » Kiln-Extensions
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

5.5.0 Fixed the kiln auth to work with the 5.5 version of tortoise HG

Changeset 98a58c679345

Parent 8daab782def8

by Profile picture of Daniel PupekDaniel Pupek

Changes to 4 files · Browse files at 98a58c679345 Showing diff from parent 8daab782def8 Diff from another changeset...

Change 1 of 2 Show Entire File kiln.py Stacked
 
52
53
54
55
 
56
57
58
 
895
896
897
898
 
 
 
 
 
 
 
 
899
900
901
 
52
53
54
 
55
56
57
58
 
895
896
897
 
898
899
900
901
902
903
904
905
906
907
908
@@ -52,7 +52,7 @@
   from cookielib import MozillaCookieJar  from hashlib import md5 -from mercurial import (commands, cmdutil, demandimport, extensions, hg, +from mercurial import (commands, cmdutil, registrar, demandimport, extensions, hg,   localrepo, match, util)  from mercurial import ui as hgui  from mercurial import url as hgurl @@ -895,7 +895,14 @@
  return needles.intersection(haystacks)    cmdtable = {} -command = cmdutil.command(cmdtable) + +if hasattr(cmdutil, 'command'): + # Mercurial 4.6 or less + command = cmdutil.command(cmdtable) +else: + # Mercurial 4.7+ + command = registrar.command(cmdtable) +  @command('kiln',   [('a', 'annotate', [], _('annotate the file provided')),   ('c', 'changes', None, _('view the history of this repository; this is the default')),
Change 1 of 3 Show Entire File kilnauth.py Stacked
 
55
56
57
 
58
59
60
 
183
184
185
186
 
187
188
 
189
190
191
 
222
223
224
225
 
 
 
 
 
 
 
 
226
227
228
 
55
56
57
58
59
60
61
 
184
185
186
 
187
188
 
189
190
191
192
 
223
224
225
 
226
227
228
229
230
231
232
233
234
235
236
@@ -55,6 +55,7 @@
 import mercurial.url  from mercurial import commands  from mercurial import cmdutil +from mercurial import registrar    current_user = None   @@ -183,9 +184,9 @@
  except:   current_user = ''   -def extsetup(): +def extsetup(ui):   global current_user - ui = mercurial.ui.ui() +   current_user = get_username(get_dest(ui))     def open_wrapper(func): @@ -222,7 +223,14 @@
  opt_no_repo = {'norepo': True}    cmdtable = {} -command = cmdutil.command(cmdtable) + +if hasattr(cmdutil, 'command'): + # Mercurial 4.6 or less + command = cmdutil.command(cmdtable) +else: + # Mercurial 4.7+ + command = registrar.command(cmdtable) +  @command('logout', [], _('[domain]'), **opt_no_repo)  def logout(ui, domain=None, **opts):   """log out of http repositories
Change 1 of 1 Show Entire File tests/​runner.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
@@ -1,34 +1,34 @@
-import os -import subprocess -import sys -import hgtest - -path = os.path.dirname(os.path.realpath(__file__)) - -args = vars(hgtest.parse_args()) -arglist = [] -for opt, val in args.iteritems(): - arglist.extend(['--' + opt, val]) - -files = os.listdir(path) -failures = 0 - -for file in files: - if file.startswith("test") and file.endswith(".py"): - try: - child = subprocess.Popen(["python", os.path.join(path, file)] + arglist, - stdout=sys.stdout, - stderr=sys.stderr, - stdin=sys.stdin, - universal_newlines=True) - - ret = child.wait() - if ret != 0: - failures += 1 - except: - if child.poll(): - child.kill() - raise - -if failures > 0: +import os +import subprocess +import sys +import hgtest + +path = os.path.dirname(os.path.realpath(__file__)) + +args = vars(hgtest.parse_args()) +arglist = [] +for opt, val in args.iteritems(): + arglist.extend(['--' + opt, val]) + +files = os.listdir(path) +failures = 0 + +for file in files: + if file.startswith("test") and file.endswith(".py"): + try: + child = subprocess.Popen(["python", os.path.join(path, file)] + arglist, + stdout=sys.stdout, + stderr=sys.stderr, + stdin=sys.stdin, + universal_newlines=True) + + ret = child.wait() + if ret != 0: + failures += 1 + except: + if child.poll(): + child.kill() + raise + +if failures > 0:   sys.exit("%i files failed" % failures) \ No newline at end of file
Change 1 of 1 Show Entire File tests/​test-kilnauth.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@@ -1,38 +1,38 @@
-import hgtest -import os - -hgt = hgtest.Tester(auth=False) -hgt.announce('setup') -token = hgt.gettoken() -hgt.deletetest(token) -test = hgt.createtest(token) -hgt.hg(['clone', hgt.test_url(), 'repo1'], log=False, auth=True, - stdout='''no changes found -updating to branch default -0 files updated, 0 files merged, 0 files removed, 0 files unresolved -''') -os.chdir('repo1') - -hgt.hg(['logout']) - -hgt.hg(['pull'], stdin='\n\n', status=-1, - stderr='abort: http authorization required for %s' % hgt.test_url(), - stdout='''pulling from %s -''' % hgt.test_url()) - -hgt.hg(['pull'], auth=True, - stdout='''pulling from %s -no changes found -''' % hgt.test_url()) - -hgt.hg(['pull'], - stdout='''pulling from %s -no changes found -''' % hgt.test_url()) - -hgt.hg(['logout']) - -hgt.hg(['pull'], stdin='\n\n', status=-1, - stderr='abort: http authorization required for %s' % hgt.test_url(), - stdout='''pulling from %s -''' % hgt.test_url()) +import hgtest +import os + +hgt = hgtest.Tester(auth=False) +hgt.announce('setup') +token = hgt.gettoken() +hgt.deletetest(token) +test = hgt.createtest(token) +hgt.hg(['clone', hgt.test_url(), 'repo1'], log=False, auth=True, + stdout='''no changes found +updating to branch default +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +''') +os.chdir('repo1') + +hgt.hg(['logout']) + +hgt.hg(['pull'], stdin='\n\n', status=-1, + stderr='abort: http authorization required for %s' % hgt.test_url(), + stdout='''pulling from %s +''' % hgt.test_url()) + +hgt.hg(['pull'], auth=True, + stdout='''pulling from %s +no changes found +''' % hgt.test_url()) + +hgt.hg(['pull'], + stdout='''pulling from %s +no changes found +''' % hgt.test_url()) + +hgt.hg(['logout']) + +hgt.hg(['pull'], stdin='\n\n', status=-1, + stderr='abort: http authorization required for %s' % hgt.test_url(), + stdout='''pulling from %s +''' % hgt.test_url())