跳到主要內容

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的驅動程式,剩下的就是政府單位的網頁和程式應該改版了吧!!!

Personal Bookmark

Java SE 6 + Firefox 2 UI 問題 As I do . Google拋棄了了SOAP API,浮想聯翩 https://www.gandi.net/ VS 2005 SP1中文版推出 Windows Vista中文版下載 ASP.NET 2.0網頁執行管線與快取原理 Cache 2.0快取架構與快取資料自動移除架構圖 flickr sync 分享與試用 SUN Looking Glass 3D圖形介面發布1.0 雅虎勵精圖治推動改革 Wait and see 國內某SOC疑遭駭客入侵 大砲開講 Very Important! 微軟公佈Vista安全程式介面草案 一窺Google開原碼庫房乾坤 qing is writing a dig girl net... wait and see