Move Mercurial Repository To Another Server -
we have project lives in mercurial repository.
our customer take ownership of code base doing following:
- set mercurial repository on server belonging customer.
- import existing code new mercurial repository.
what best way achieve step 2?
is simple matter of doing following:
clone existing mercurial repository:
hg clone <existing mercurial repo url>
push cloned repository new one:
hg push <new mercurial repo url>
am missing steps? hgrc file? have modified in way prior pushing project new repository?
yes, can state, worth noting if simple hg clone
of main repository, link exist between two, may not want. can remove link editing .hg/hgrc
file , removing default = ...
item in [paths]
section.
i find better way without cloning. way don't have link between repositories, going customer may want.
the basic method set new repository with no changesets, , bring in of changesets in 1 of 3 ways:
- push changes repository new repository.
- pull changes new repository old.
- if don't have access new repository, create bundle can provided customer - can unbundled or pulled empty repo.
pushing , pulling done would, specifying repository location:
// create empty repository hg init . // pull in old repo hg pull /projects/myoriginalrepo
or push...
// create empty repository hg init /projects/mynewrepo cd /projects/myoriginalrepo hg push /projects/mynewrepo
creating bundle perhaps nicer way, can write bundle onto dvd , give customer wrapped in bow nice greeting card:
cd /projects/myoriginalrepo hg bundle --all ../repo.bundle
everything gets written out single file, can extracted hg unbundle repo.bundle
or hg pull repo.bundle
, repository no existing changesets.
regarding hgrc
file, mentioned in answer not controlled file, , won't copied. however, contents things hooks perform auto-building, or validating changesets before applied. logic make sense own organisation, , suggest wouldn't want imposed on customer - are, after all, taking ownership of code-base, , may have own systems in place things this.
Comments
Post a Comment