This is an old revision of the document!
Table of Contents
mecurial
QUEUE: hg qnew “comment” patch_name.diff hg qpop 把最上面的的patch移出队列 hg qpush 应用一个patch hg qremove patch_name 删除一个队列,只有被pop出来的patch才能被删除 hg qser 查看所有已有的patch hg qapp 查看所有被应用的patch hg qfinish -a finish 之后的patch才能被提交 hg qimport “C:\test.diff” 导入指定patch文件,之后需要执行qpush才能把新导入的queue应用上 hg qimport -r 12345 把已经finish的changeset再变回queue,-r后的参数为changeset的版本号 OTHER: hg purge 删除所有新增的文件 hg pull –rebase 本地有q的时候使用,从center repository上得到最新更新,并在更新的代码上应用本地的queues
svn ( Subversion )
| Add all files without any ignore for the first time to import to svn | svn add --force --no-ignore |
| add all new files, even for files/directories started with ., for example .hgsub | svn status | grep '\?' | awk '{print $2}' | xargs svn add |
| delete all files which is missing in the svn repository | svn status | grep '^!' | awk '{print $2}' | xargs svn delete --force |
Remote Fully Backup Repository
| Backup Example | svnrdump dump svn://myrepohost.com:port/repos/myproject > C:\myrepobackup.dump |
| Restore Example | svnrdump load svn://myrepohost.com:port/repos/newproject < C:\myrepobackup.dump |
Remote Partially Backup Repository
Basic the script is like below to clone openwrt svn repo to local windows PC:
dest_repo="https://sgh-pc/svn/openwrt" src_repo="svn://svn.openwrt.org/openwrt" #create local empty repository: one time effort #svnadmin create --fs-type fsfs ./openwrt #int Pre-revision-change.cmd hook: just exit 0 should be ok #syn initialize from openwrt repo to local repo: one time effort #svnsync init $dest_repo $src_repo --sync-username svnsync --sync-password svnsync #main script to syn openwrt to local repo: svnsync sync $dest_repo $src_repo --sync-username svnsync --sync-password svnsync
In Windows, use visualsvn as svn server.
Note: if windows file system is NTFS, it had better set VisualSVN Server and visualSVN service login with windows administrator. Its detail path is :
Start→Control Panel → Administrative Tools → Services →
Otherwise, it will report trick errors, like: access Pre-revision-change fail or non-exist, access write-lock fail and so on.
