Commit Graph

330 Commits

Author SHA1 Message Date
Matt Mackall
41d9aaebb8 Add support for url#id syntax
This allows you to do:

 hg clone http://server/repo#stable

which is equivalent to:

 hg clone -r stable http://server/repo

Future incoming, outgoing, and push commands will default to using
this id because it's recorded in the default path.

Other commands that accept URLs (push, pull, bundle, incoming, and
outgoing) also accept this syntax.
2007-06-01 18:40:14 -05:00
Matt Mackall
aa00d22e56 clone: checkout the "default" branch if available 2007-06-01 18:52:18 -05:00
Alexis S. L. Carvalho
744364abd4 merge with crew-stable 2007-02-13 10:25:45 -02:00
Alexis S. L. Carvalho
06a58ad86b Try to pass repo.ui to reposetup hooks
The ui object we received in this function may belong to another repo,
which could be confusing from the hook point of view.  Trying to use
the ui object from the newly created repo should avoid this confusion.
2007-02-08 16:31:21 -02:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Thomas Arendsen Hein
a721ac99f0 Add instructions how to redo/finish failed merge with local working directory.
d29fcc4d1e2a already implemented this for branch merges.
2006-12-11 18:09:52 +01:00
Matt Mackall
6d9bbc8702 Merge Benoit's .hg/store support 2006-12-10 02:11:02 -06:00
Thomas Arendsen Hein
731e6e0280 Show the destionation for clone if not specified manually. 2006-12-09 14:19:52 +01:00
Benoit Boissinot
84f8507dc8 introduce localrepo.spath for the store path, sopener fixes 2006-12-05 11:28:23 +01:00
Benoit Boissinot
e005ffc8c4 switch to the .hg/store layout, fix the tests 2006-12-01 13:34:09 +01:00
Benoit Boissinot
69d31c9562 add "requires" file to the repo, specifying the requirements 2006-12-10 00:06:59 +01:00
Benoit Boissinot
c9f89fd48e don't use localrepo.__init__ to create the dest repo with clone+hardlinks 2006-12-10 00:06:43 +01:00
Benoit Boissinot
684e2e23c3 don't create the .hg/data at init time 2006-11-27 22:22:44 +01:00
Thomas Arendsen Hein
d3c6666f73 Indentation cleanups for 16c127c30658. 2006-11-19 16:09:04 +01:00
Marcos Chaves
794888ecba fix warnings generated by pygettext.py. 2006-11-18 17:20:38 -02:00
Eric Hopper
b804ede3e2 Stop erroring out pull -r and clone -r if repository isn't local. 2006-09-09 18:25:07 -07:00
Matt Mackall
8c602e592a imported patch foo 2006-10-17 22:34:43 -05:00
Matt Mackall
7a65ba3d4f Update branch on checkout/update 2006-10-17 18:30:20 -05:00
Matt Mackall
fef0705ae8 merge: pull user messages out to hg.py
- add _update for shadowing in clone
- add _showstats helper
- remove update parameter defaults
- move stats message and merge help messages
2006-10-10 03:39:44 -05:00
Brendan Cully
3de86cce52 Make hg.repository work with no path argument 2006-09-29 13:00:36 -07:00
Thomas Arendsen Hein
d2082f10fc Never apply string formatting to generated errors with util.Abort.
Otherwise error messages containing % chars yield errors or worse.
Fixed (hopefully) all users of util.Abort.
2006-09-08 09:36:18 +02:00
Benoit Boissinot
518dc48563 clone: simplifying dest repo creation
since creating a repo raises an exception if the repo already
exists, there's no need to try to create one.
add some test for repo creation when the destination exists
2006-09-02 23:26:10 +02:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Vadim Gelfer
5a39b6dc91 call reposetup functions of extension modules whenever repo created 2006-08-10 15:44:05 -07:00
Matt Mackall
55b6f733d9 Merge: combine force and forcemerge arguments 2006-08-08 10:56:48 -05:00
Matt Mackall
0b0ee1ba50 Refactor update locking slightly 2006-08-08 09:19:20 -05:00
Matt Mackall
60a6e68764 Merge: combine choose and moddirstate to partial 2006-08-08 09:11:16 -05:00
Matt Mackall
26928ff9de Rename merge.allow -> merge.branchmerge 2006-08-07 23:53:04 -05:00
Matt Mackall
ba80b068a7 Use demandload @ syntax 2006-08-07 23:18:16 -05:00
Matt Mackall
de047b03ce Introduce update helper functions: update, merge, clean, and revert 2006-08-07 22:54:33 -05:00
Matt Mackall
d5009b5b05 Move repo.verify 2006-08-07 16:27:09 -05:00
Matt Mackall
65b6faa1aa Move merge code to its own module
Pull update and merge3 out of localrepo into merge.py
s/self/repo/
Add temporary API function in hg.py
Convert all users
2006-08-03 15:24:41 -05:00
Matt Mackall
1daa0d8fba Add a doc string 2006-08-03 13:07:57 -05:00
Vadim Gelfer
338d2303a1 allow None for path of hg.repository 2006-08-02 12:46:00 -07:00
Vadim Gelfer
b7a96d1742 clean up hg.py: move repo constructor code into each repo module 2006-07-31 07:11:12 -07:00
Vadim Gelfer
fc31092ae7 pull: allow to pull from bundle file without need for bundle: syntax 2006-07-30 21:46:38 -07:00
Vadim Gelfer
9139c6368e hg.py: add islocal() and defaultdest() functions, refactor
islocal tells if a repo or url is local.

defaultdest returns default path for clone if explicit path not given.

clone can now take repo or url as source
2006-07-28 10:46:25 -07:00
Benoit Boissinot
8ef31fb9ac codingstyle: use spaces instead of tabs 2006-07-18 00:32:18 +02:00
Vadim Gelfer
f7b6882acb clone: disable stream support on server side by default.
enable in hgrc like this:
[server]
stream=True
2006-07-15 16:06:35 -07:00
Vadim Gelfer
4bc0558c57 clone: do not make streaming default. add --stream option instead. 2006-07-14 14:51:36 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
Vadim Gelfer
e0b0ae3431 clean up trailing white space. 2006-07-12 08:28:00 -07:00
Vadim Gelfer
5f404bd1f9 clone: move code into hg module. make doc better.
api in commands module is still same, but version in hg is best for
calling within python now.
2006-07-11 16:18:53 -07:00
Vadim Gelfer
8a2a795f3f parse url schemes more strictly.
previous code mistook repo named "hg" for scheme named "hg".
2006-07-11 15:52:36 -07:00
Benoit Boissinot
7dd019b60b use __contains__, index or split instead of str.find
str.find return -1 when the substring is not found, -1 evaluate
to True and is a valid index, which can lead to bugs.
Using alternatives when possible makes the code clearer and less
prone to bugs. (and __contains__ is faster in microbenchmarks)
2006-07-09 01:30:30 +02:00
Alexis S. L. Carvalho
fd806fb861 hg.py: move exception handling code to try to avoid hiding errors 2006-07-02 22:39:39 -03:00
Sean Meiners
34ff4a6539 Added ability to clone from a local repository to a (new) remote one.
Rearranged the clone command a good bit to make sure it validates that
the source does exist and that the destination doesn't before doing anything.
Before I moved the source repo check it would create the destination
repository before it verified the source existed.

Moved the responsibility for creating the destination repo root directory
entirly into the localrepo class so that local to local cloning doesn't break.
This also simplifies the code a bit since it's no longer being done in both
clone and init.

Changed the names of the 'repo' and 'other' variables to 'dest_repo' and
'src_repo' to maintain my sanity.

Passes 82/83 tests. The only failure is the version number test, which I
suspect is supposed to fail since it comes from a generated file.
2006-06-30 19:24:02 -07:00
Vadim Gelfer
acba08e292 hg.repository: many routines expect path to be a string even if empty. 2006-06-21 17:09:29 -07:00
Vadim Gelfer
529a731a4f make repo scheme table driven. 2006-06-21 09:14:36 -07:00