开发者

whats the best strategy for automatically cloning a repo to a network drive?

开发者 https://www.devze.com 2023-01-31 12:17 出处:网络
I have a repository on my local machine that is under SVN. For various reasons the SVN branch that I\'m working on is locked and I\'m not supposed to make another branch. I\'d like to be able to make

I have a repository on my local machine that is under SVN. For various reasons the SVN branch that I'm working on is locked and I'm not supposed to make another branch. I'd like to be able to make many local commits via Mercurial, then copy/push those changes up to a network drive so that they're backed up every night. When the SVN branch is open again I'll push the final changes up to it.

None of this seems out of the ordinary. I made my local repo, made some changes to it and commited them. Then I made an empty repo on the remote drive and tried to hg push the changes. After several hours it was only 33% done. The total repo is about 80MB (6.7GB of files in the code folder). I really don't want to wait all day every开发者_运维技巧 time I make a commit.

I decided to bag the hg push and use hg clone instead.

It went like this (using PowerShell):

PS C:\Dev\Projects\Project1> hg status
PS C:\Dev\Projects\Project1> hg clone H:\Repo\Projects
**abort: repository H:\Repo\Projects not found!**

Ok, so I apparently need a repository in H:\Repo\Projects. So I go over there and use hg init to make an empty repository. After that I try this:

PS C:\Dev\Projects\Project1> hg clone H:\Repo\Projects
destination directory: Projects
**abort: destination 'Projects' is not empty**

What does Mercurial want here? An empty directory? Well no, then it can't find a repo. An empty repo? No then it tells me that the destination is not empty. A brand new folder like hg clone H:\Repo\Projects\TheNewFolder? No, then I get a repo not found message.

What's the best way (or any) way to do this? I seem to be stuck between "takes all day" or "doesn't work at all".


If you're in C:\Dev\Projects\Project1 and you want to clone it to H:\Repo\Projects the command is cd .. followed by hg clone Project1 H:\Repo\Projects which says clone Project1 to there. You were trying to clone H:\Repo\Projects into the current directory.

Clone won't be any faster than push -- clone is just hg init ; hg pull.

There's no reason your 80MB repo (unless you meant 80GB) should take more than a blink to push/pull to a new empty repo. If it was 80GB it'll only be slow that once and henceforth push/pull will just send the new changeset.


You really need to reword your question, but I'm guessing you need to add the files and commit, also check the convert extension.

hg add -a
hg commit -m 'initial'

Edit the directory you're cloning into already has a directory called Projects, remove it or rename it.

0

精彩评论

暂无评论...
验证码 换一张
取 消