Changeset 8daab782def8…
Parent b5877437d2f5…
by
Changes to 2 files · Browse files at 8daab782def8 Showing diff from parent b5877437d2f5 Diff from another changeset...
@@ -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]'))
-}
|
@@ -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)))
|
Loading...