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

default Update extensions to support Mercurial 4.3.1

Changeset 8daab782def8

Parent b5877437d2f5

by David Hodgson

Changes to 2 files · Browse files at 8daab782def8 Showing diff from parent b5877437d2f5 Diff from another changeset...

Change 1 of 7 Show Entire File kiln.py Stacked
 
469
470
471
472
 
473
474
475
 
478
479
480
481
 
482
483
484
 
492
493
494
495
 
496
497
498
 
500
501
502
 
 
 
 
 
 
 
503
504
505
 
669
670
671
672
673
 
 
674
675
676
 
887
888
889
890
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
892
893
 
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
 
469
470
471
 
472
473
474
475
 
478
479
480
 
481
482
483
484
 
492
493
494
 
495
496
497
498
 
500
501
502
503
504
505
506
507
508
509
510
511
512
 
676
677
678
 
 
679
680
681
682
683
 
894
895
896
 
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
 
1019
1020
1021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -469,7 +469,7 @@
  audit_path = build_audit_path(repo)   audit_path('hgrc')   audit_path('hgrc.backup') - base = repo.opener.base + base = get_opener(repo).base     hgrc, backup = [os.path.join(base, x) for x in 'hgrc', 'hgrc.backup']   if os.path.exists(hgrc): @@ -478,7 +478,7 @@
  ui.setconfig('paths', path, value)     try: - fp = repo.opener('hgrc', 'a', text=True) + fp = get_opener(repo)('hgrc', 'a', text=True)   # Mercurial assumes Unix newlines by default and so do we.   fp.write('\n[paths]\n%s = %s\n' % (path, value))   fp.close() @@ -492,7 +492,7 @@
  audit_path = build_audit_path(repo)   audit_path('hgrc')   audit_path('hgrc.backup') - base = repo.opener.base + base = get_opener(repo).base     hgrc, backup = [os.path.join(base, x) for x in 'hgrc', 'hgrc.backup']   if os.path.exists(backup): @@ -500,6 +500,13 @@
  else:   os.remove(hgrc)   +def get_opener(repo): + if hasattr(repo, 'opener'): + # deprecated command + return repo.opener + else: + # Mercurial 3.8? and above + return repo.vfs    def guess_kilnpath(orig, ui, repo, dest=None, **opts):   if not dest: @@ -669,8 +676,8 @@
  raise util.Abort(_('Invalid URL: %s') % url)     paths = url.split('/') - project, group, repo = paths[-3:] - repo = call_api(repo.ui, baseurl, 'Api/1.0/Project/%s/Group/%s/Repo/%s' % (project, group, repo), dict(token=token)) + project, group, repo_name = paths[-3:] + repo = call_api(repo.ui, baseurl, 'Api/1.0/Project/%s/Group/%s/Repo/%s' % (project, group, repo_name), dict(token=token))     if 'errors' in repo:   return None @@ -887,7 +894,21 @@
  haystacks = set(map(os.path.normpath, haystacks))   return needles.intersection(haystacks)   - +cmdtable = {} +command = cmdutil.command(cmdtable) +@command('kiln', + [('a', 'annotate', [], _('annotate the file provided')), + ('c', 'changes', None, _('view the history of this repository; this is the default')), + ('f', 'file', [], _('view the file contents')), + ('l', 'filehistory', [], _('view the history of the file')), + ('o', 'outgoing', None, _('view the repository\'s outgoing tab')), + ('s', 'settings', None, _('view the repository\'s settings tab')), + ('p', 'path', '', _('select which Kiln branch of the repository to use')), + ('r', 'rev', [], _('view the specified changeset in Kiln')), + ('t', 'targets', None, _('view the repository\'s targets')), + ('n', 'new-branch', '', _('asynchronously create a new branch from the current repository')), + ('', 'logout', None, _('log out of Kiln sessions'))] + )  def kiln(ui, repo, **opts):   '''show the relevant page of the repository in Kiln   @@ -998,20 +1019,3 @@
  extensions.wrapcommand(f.cmdtable, 'fetch', guess_kilnpath)   except KeyError:   pass - -cmdtable = { - 'kiln': - (kiln, - [('a', 'annotate', [], _('annotate the file provided')), - ('c', 'changes', None, _('view the history of this repository; this is the default')), - ('f', 'file', [], _('view the file contents')), - ('l', 'filehistory', [], _('view the history of the file')), - ('o', 'outgoing', None, _('view the repository\'s outgoing tab')), - ('s', 'settings', None, _('view the repository\'s settings tab')), - ('p', 'path', '', _('select which Kiln branch of the repository to use')), - ('r', 'rev', [], _('view the specified changeset in Kiln')), - ('t', 'targets', None, _('view the repository\'s targets')), - ('n', 'new-branch', '', _('asynchronously create a new branch from the current repository')), - ('', 'logout', None, _('log out of Kiln sessions'))], - _('hg kiln [-p url] [-r rev|-a file|-f file|-c|-o|-s|-t|-n branchName|--logout]')) -}
Change 1 of 1 Show Entire File tests/​hgtest.py Stacked
 
123
124
125
126
 
127
128
129
 
123
124
125
 
126
127
128
129
@@ -123,7 +123,7 @@
  def createtest(self, token):   self.init_project(token)   - repo = self.slurp(self.api('Repo/Create'), dict(sName='Test', sDescription='test', ixRepoGroup=self.ix_group, sDefaultPermission='write', token=token)) + repo = self.slurp(self.api('Repo/Create'), dict(sName='Test', sDescription='test', ixRepoGroup=self.ix_group, sDefaultPermission='write', token=token, vcs=1))   ixRepo = repo['ixRepo']     self.asserttrue(isinstance(ixRepo, int), 'Create failed %s' % (str(ixRepo)))