Changeset a3769970ee05…
Parent f83ef1d2374f…
by
Changes to 4 files · Browse files at a3769970ee05 Showing diff from parent f83ef1d2374f Diff from another changeset...
@@ -53,3 +53,25 @@ ::ShellExecute(NULL, NULL, strKilnUrl, NULL, NULL, SW_SHOW);
}
}
+
+void KilnOpenFiles(const CString& strPath, const CAtlArray<CString>& arrFiles)
+{
+ CString strKilnUrl;
+ if (KilnGetUrl(strPath, &strKilnUrl))
+ {
+ if (strKilnUrl[strKilnUrl.GetLength() - 1] != '/')
+ strKilnUrl += '/';
+ strKilnUrl += "Files/";
+
+ CString strHgRoot;
+ GetHgRoot(strPath, strHgRoot);
+
+ // Open each file in the default web browser
+ for (int i = 0; i < arrFiles.GetCount(); i++)
+ {
+ CString strRelPath;
+ GetRelPath(strHgRoot, arrFiles[i], strRelPath);
+ ::ShellExecute(NULL, NULL, strKilnUrl + strRelPath, NULL, NULL, SW_SHOW);
+ }
+ }
+}
|
@@ -17,3 +17,4 @@
bool KilnGetUrl(const CString& strPath, CString* pstrKilnUrl = NULL);
void KilnOpenRepo(const CString& strPath);
+void KilnOpenFiles(const CString& strPath, const CAtlArray<CString>& arrFiles);
|
@@ -16,5 +16,6 @@ #pragma once
int GetHgRoot(const CString& strPath, CString& strHgRoot);
+int GetRelPath(const CString& strHgRoot, const CString& strPath, CString& strRes);
int HgQueryDirstate(char chClass, const CString& strPath, char chFilterStatus,
char& chOutStatus);
|
@@ -112,6 +112,9 @@ { "kiln", L"Kiln",
L"Opens the current repository in Kiln.",
"kiln.ico", 0 },
+ { "kilnfiles", L"Kiln",
+ L"Opens the selected files in Kiln.",
+ "kiln.ico", 0 },
// Add new items here.
// Template:
@@ -132,7 +135,7 @@static const char* const RepoFilesMenu =
"commit status vdiff sep"
" add revert rename forget remove sep"
- " log annotate sep"
+ " log annotate sep kilnfiles sep"
" about";
static const char* const NoRepoMenu =
@@ -140,7 +143,7 @@ " workbench sep"
" about";
-static const LPCTSTR DefaultPromotedString = "commit,workbench,kiln";
+static const LPCTSTR DefaultPromotedString = "commit,workbench,kiln,kilnfiles";
void CTortoiseHgCmenuBase::AddMenuList(UINT idCmd, const CString& strName)
{
@@ -507,7 +510,7 @@ CString strName = listEntries.GetNext(position);
if (listPromoted.Find(strName) != NULL)
{
- if (strName == "kiln" && !KilnGetUrl(strCwd))
+ if ((strName == "kiln" || strName == "kilnfiles") && !KilnGetUrl(strCwd))
continue;
InsertMenuItemByName(hMenu, strName, indexMenu++, idCmd++, idCmdFirst, L"Hg ");
}
@@ -535,7 +538,7 @@ {
if (listPromoted.Find(strName) == NULL)
{
- if (strName == "kiln" && !KilnGetUrl(strCwd))
+ if ((strName == "kiln" || strName == "kilnfiles") && !KilnGetUrl(strCwd))
continue;
InsertMenuItemByName(hSubMenu, strName, indexSubMenu++, idCmd++,
idCmdFirst, L"");
@@ -820,6 +823,11 @@ KilnOpenRepo(strCwd);
return;
}
+ else if (strCmd == "kilnfiles")
+ {
+ KilnOpenFiles(strCwd, m_arrFiles);
+ return;
+ }
if (!m_arrFiles.IsEmpty())
{
|
Loading...