could we add an option to save the patchfile to work directory ?

28 views
Skip to first unread message

kaw...@gmail.com

unread,
Mar 27, 2020, 9:06:27 AM3/27/20
to TortoiseSVN
Hi team:

i write a command with name rbt.bat which uses rbtools  to put patch file to reviewboard

in this command, i should know the base directory of patch file, but it's difficult , i only know the work directory of TortoiseProc.exe

so i rebuild TortoiseProc.exe with below code, could the Team add an option to config this ?



bool CreatePatchCommand::Execute()
{
    bool bRet = false;
    auto savepath = CPathUtils::GetLongPathname(parser.GetVal(L"savepath"));
    CCreatePatch dlg;
    dlg.m_pathList = pathList;
    if (parser.HasKey(L"noui")||(dlg.DoModal()==IDOK))
    {
        if (cmdLinePath.IsEmpty())
        {
            cmdLinePath = pathList.GetCommonRoot();
        }
        if (parser.HasKey(L"showoptions"))
        {
            CDiffOptionsDlg optionsdlg(CWnd::FromHandle(GetExplorerHWND()));
            optionsdlg.SetDiffOptions(dlg.m_diffOptions);
            if (optionsdlg.DoModal() == IDOK)
                dlg.m_diffOptions = optionsdlg.GetDiffOptions();
            else
                return false;
        }
        
        if (/*configed*/)
        {
        bRet = CreatePatch(CTSVNPath(sOrigCWD), dlg.m_pathList, dlg.m_bPrettyPrint, dlg.m_diffOptions, CTSVNPath(savepath.c_str()));
        }
        else /*default*/
        {
        bRet = CreatePatch(pathList.GetCommonRoot(), dlg.m_pathList, dlg.m_bPrettyPrint, dlg.m_diffOptions, CTSVNPath(savepath.c_str()));
        }
        
        SVN svn;
        svn.Revert(dlg.m_filesToRevert, CStringArray(), false, false, false);
    }
    return bRet;
}

Stefan

unread,
Mar 28, 2020, 3:06:24 AM3/28/20
to TortoiseSVN
why do you need the CWD?
how do you call TortoiseProc to create the patch?

小鱼儿

unread,
Mar 30, 2020, 10:09:18 PM3/30/20
to TortoiseSVN on behalf of Stefan
first i set the diff viewer with the command "rbtauto.bat"
and then create patch  and save, TortoiseProc will cal  rbtauto.bat, 
in  rbtauto.bat , i collect the patch file and send it to reviewboard server.

for example
f:/pclint/vca/src/alarm/vca_alarm.c

the CWD is f:/pclint/vca/
the patch file looked like 2020-03-31_094958.png, 

rbtauto.bat  works in f:/pclint/vca/ , and it can only get URL http://10.30.30.186/svn/s6_8127/trunk/application/vca
it's difficult to know the URL of patch file correctly

so i think it's good if  TortoiseProc adds some option to config the directory of patchfile.



Stefan via TortoiseSVN <torto...@googlegroups.com> 于2020年3月28日周六 下午3:06写道:
why do you need the CWD?
how do you call TortoiseProc to create the patch?

--
You received this message because you are subscribed to a topic in the Google Groups "TortoiseSVN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tortoisesvn/RAYTCc49MqE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tortoisesvn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn/e08bca73-f3e0-4b18-a418-7a3f979dfadb%40googlegroups.com.
2020-03-31_094320.png
2020-03-31_094244.png
2020-03-31_094958.png

Stefan

unread,
Apr 1, 2020, 10:13:39 AM4/1/20
to TortoiseSVN
you configured your tool as the diff file viewer. Which means it is not only called when creating a patch like you do in the screenshots. It's also called when doing a diff in the log dialog of two revisions, from the repo browser when doing diffs, ...
Think about this: do you really want to automatically send these patches to reviewboard?

小鱼儿

unread,
Apr 1, 2020, 10:41:29 PM4/1/20
to TortoiseSVN on behalf of Stefan
first  the log dialog of two revisions called, then the diffviewer called

normally, 
1, i create patch file  diff.patch
2. open reviewboard server in chrome brower
3. upload the diff.patch file
4. fill the base svn URL of diff.patch
5. fill some information about this diff.patch 
6. publish this diff.patch to  reviewboard server

in the "rbtauto.bat" tools , i can do all these in one step.  it can save time.





Stefan via TortoiseSVN <torto...@googlegroups.com> 于2020年4月1日周三 下午10:13写道:
you configured your tool as the diff file viewer. Which means it is not only called when creating a patch like you do in the screenshots. It's also called when doing a diff in the log dialog of two revisions, from the repo browser when doing diffs, ...
Think about this: do you really want to automatically send these patches to reviewboard?

--
You received this message because you are subscribed to a topic in the Google Groups "TortoiseSVN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tortoisesvn/RAYTCc49MqE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tortoisesvn...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages