Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
597 views
in Technique[技术] by (71.8m points)

svn - folder structure in a mercurial repo?

I have just switched from svn to mercurial and have read some tutorials about it.
I've still got some confusions that i hope you could help me to sort out.
I wonder if I have understood the folder structure in a mercurial repo right.
In a svn repo I usually have these folders:

svn:

branches (branches/chat, branches/new_login etc)
tags (version1.0, version2.0 etc)
sandbox
trunk

Should a branch actually be another clone of the original/central repo in mercurial?
it seemed like that when I read the manual.

And a tag is just a named identifier, but you should clone the original/central repo whenever you want to create a tag?

How about the sandbox? should that be another clone too?

So basically you just have in a repo all the folders/files that you would have in the trunk folder?

mercurial:

central repo: projects folders/files (not in any parentfolder)
tag repo: cloned from central repo at a given moment for release 
  (version1.0, version2.0 etc)
branch repo: cloned from central repo for adding features (chat, new_login etc)
sandbox repo: experimental repo (could be pushed to central repo, or just deleted)

is this correct?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The main thing to remember is that branches are no longer directories in a DVCS like Mercurial (or Git).

Mercurial offers 4 branch models (details in this SO question and in this article):

  • clone
  • bookmark
  • named branch
  • anonymous branch

The ConvertExtension uses by default named branch (but you have option to use cloned or tagged branches)

Try out some SVN to Mercurial Conversion cases, and see what works best in your case.
Once a SVN repo has been imported in one Mercurial repo (with named branches in it), you still can clone whatever branch you need in a separate repo:

hg clone -r <branch-head-rev> <repo> <new-repo>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...