跳到主要內容

Subversion同時使用兩個Repository

Subversion應該沒有支援Dual Repository的機制,由於平時偷懶把自己寫的幾支程式都放在同一個Repository,需要分享時就很麻煩。原本想利用Apache的虛擬目錄 Alias 的方式達成,但目前看來不可行;再使用mod_proxy的方式也有權限問題,無法達成目標。

所以我利用 Subversion 1.3版開始非正式支援SVN_ASP_DOT_NET_HACK變數,就可以在同一個目錄下有兩個不同的Repository。
The "_svn" hack is now officially supported: since some versions of ASP.NET don't allow directories beginning with dot (e.g., ".svn", the standard Subversion working copy administrative directory), the svn command line client and svnversion now treat the environment variable SVN_ASP_DOT_NET_HACK specially on Windows. If this variable is set (to any value), they will use "_svn" instead of ".svn". We recommend that all Subversion clients running on Windows take advantage of this behaviour. Note that once the environment variable is set, working copies with standard ".svn" directories will stop working, and will need to be re-checked-out to get "_svn" instead.
雖然麻煩一點,但就是在命令列切換:
C:\MyAp>set SVN_ASP_DOT_NET_HACK=1
C:\MyAp>svn commit
C:\MyAp>set SVN_ASP_DOT_NET_HACK=
C:\MyAp>svn commit
或者做成批次檔切換變數。

請注意:此特性只有在Win32平台有效,在source如main.c有特別定義:
#if defined(WIN32) || defined(__CYGWIN__)
/* Set the working copy administrative directory name. */
if (getenv("SVN_ASP_DOT_NET_HACK"))
{
err = svn_wc_set_adm_dir("_svn", pool);
if (err)
return svn_cmdline_handle_exit_error(err, pool, "svn: ");
}
#endif
所以若要在其他平台有此功能,必須修改source code再自行編譯。剛才確認在1.4.2版共11個檔案要修改。

留言

這個網誌中的熱門文章

DBeaver 介面語言

DBeaver是我個人頗常用的一套跨平台Database管理工具,最近升級後發現Windows版本居然變成簡體中文,而且無法切換為英文。

自然人憑證讀卡機驅動程式

鳥毅用的是第一代的自然人憑證讀卡機,EZ100PU(後來有同事買EZmini可以讀SIM卡似乎更好),每年報稅時用一次。 本來只是要申請些政府業務,一時之間找不到光碟,沒想到在 驅動程式下載 居然看到Linux和Mac的驅動程式,剩下的就是政府單位的網頁和程式應該改版了吧!!!

如何將較高版本SQL Server複製到低版本SQL Server (降級為舊版)並保留權限及資料庫圖表

一般若是要將SQL Server裡的Database轉往其他Server時,最簡單的方式就是備份(Backup)後再還原(Restore),或者是䣃離(detach)後附加(attach)。 但是很不幸地,若是由較低版本(e.g. 2008)到較高版本(e.g. 2012)要怎麼辦呢?