New User Question: Can the work directory and repository reside in different locations?

1 view
Skip to first unread message

David Knoll

unread,
Oct 29, 2009, 8:04:05 PM10/29/09
to merc...@selenic.com

Hello all,

 

I'm a new Mercurial user and I have a basic question.  Can a Mercurial repository be located in a different directory/drive than its working directory?  I'd like for my working directory to reside on my local hard drive and the repository to reside on a mapped network drive that is backed up nightly.

 

Using TortoiseHg I can create repositories anywhere but I find I can only add files to a repository that resides within my working directory.  I don't see anywhere in the documentation any examples that indicate that the repository can reside elsewhere.  Is this possible with Mercurial?  I used to be able to do this with PVCS.

 

Thanks in advance for any clarifications or suggestions.

 

David Knoll

 

P.S. BTW, I'm running on Windows Vista 64-bit.

 

 

Steve Losh

unread,
Oct 29, 2009, 8:14:10 PM10/29/09
to David Knoll, merc...@selenic.com
Take a look at the Share Extension -- you can create a repo on the network drive and then 'hg share' it to your local drive.  When you commit in the local working directory, the data will actually go to the repo on the network drive.

_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Ted Pavlic

unread,
Oct 29, 2009, 9:08:06 PM10/29/09
to merc...@selenic.com
David --

> I'm a new Mercurial user and I have a basic question. Can a Mercurial
> repository be located in a different directory/drive than its working
> directory? I'd like for my working directory to reside on my local hard
> drive and the repository to reside on a mapped network drive that is
> backed up nightly.

See:

man hg

In particular, check out the options:

-R, --repository
repository root directory or name of overlay bundle file

--cwd change working directory

If Mercurial works like git, then you should be able to use these to put
your repository and working directories in different places. You can
create aliases that automatically setup -R and --cwd like you want.

Alternatively, you could load your repository on one drive and clone
the repository to the other where you do your work. Just remember to
push your changes back to the original drive.

Best --
Ted


--
Ted Pavlic <t...@tedpavlic.com>

Please visit my 2009 d'Feet ALS walk page:
http://web.alsa.org/goto/tedp
My family appreciates your support in the fight to defeat ALS.

Martin Geisler

unread,
Oct 30, 2009, 4:28:46 AM10/30/09
to merc...@selenic.com
Ted Pavlic <t...@tedpavlic.com> writes:

> David --
>
>> I'm a new Mercurial user and I have a basic question. Can a Mercurial
>> repository be located in a different directory/drive than its working
>> directory? I'd like for my working directory to reside on my local
>> hard drive and the repository to reside on a mapped network drive
>> that is backed up nightly.
>
> See:
>
> man hg
>
> In particular, check out the options:
>
> -R, --repository
> repository root directory or name of overlay bundle file
>
> --cwd change working directory
>
> If Mercurial works like git,

Have you tried using the above options? They are not really related to
the question at hand.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

Reply all
Reply to author
Forward
0 new messages