Commit Graph

562 Commits

Author SHA1 Message Date
Matt Mackall
d049d4f6ce hg: have peer() call _lookup directly
Note that this means that peers no longer call the extension
repository setup hooks.
2011-06-10 11:43:38 -05:00
Matt Mackall
5f2e38a0df hg: add peer method 2011-06-10 11:43:38 -05:00
Peter Arrenbrecht
d836ee3cea hg: add opts argument to clone for internal remoteui 2011-06-08 18:24:33 +02:00
Peter Arrenbrecht
66eeabddd2 hg: use capable instead of capabilities 2011-06-06 21:18:35 +02:00
Martin Geisler
4cb518e9a1 hg: remove underscores in clone function 2011-05-27 12:42:36 +02:00
Brendan Cully
b1b428c2d8 clone: make default path absolute for all local paths
This fixes the default path when cloning local repositories with hg-git, since
hg-git cancopy() is false even for local repositories.
2011-05-18 23:20:26 -07:00
Peter Arrenbrecht
d4abc4d642 discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks
discovery.findoutgoing used to be a useful hook for extensions like
hgsubversion. This patch reintroduces this version of findcommonincoming
which is meant to be used when computing outgoing changesets.
2011-05-06 14:44:18 +02:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Peter Arrenbrecht
66c54cef75 bundlerepo: fix and improve getremotechanges
Fixes the regression where incoming could show local changes
introduced by rev eecf03f0ef7c.
2011-05-02 12:36:23 +02:00
Dan Villiom Podlaski Christiansen
a563dca62b share: create 'hgrc' using an opener, like clone 2011-05-01 18:43:20 +02:00
Brodie Rao
b7f0d2a103 url: move URL parsing functions into util to improve startup time
The introduction of the new URL parsing code has created a startup
time regression. This is mainly due to the use of url.hasscheme() in
the ui class. It ends up importing many libraries that the url module
requires.

This fix helps marginally, but if we can get rid of the urllib import
in the URL parser all together, startup time will go back to normal.

perfstartup time before the URL refactoring (707e4b1e8064):

! wall 0.050692 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

current startup time (9ad1dce9e7f4):

! wall 0.070685 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

after this change:

! wall 0.064667 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
2011-04-30 09:43:20 -07:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Alexander Solovyov
0eb3836642 remove unused imports and variables 2011-04-30 13:59:14 +02:00
Idan Kamara
762d333ae9 eliminate various naked except clauses 2011-04-23 00:51:25 +03:00
Thomas Arendsen Hein
1b0518593c hg: make parseurl() consistently return normalised path
Before this the path was only normalised when a fragment was used.
2011-04-06 12:48:59 +02:00
Brodie Rao
3a43fa887e url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
This replaces util.drop_scheme() with url.localpath(), using url.url for
parsing instead of doing it on its own. The function is moved from
util to url to avoid an import cycle.

hg.localpath() is removed in favor of using url.localpath(). This
provides more consistent behavior between "hg clone" and other
commands.

To preserve backwards compatibility, URLs like bundle://../foo still
refer to ../foo, not /foo.

If a URL contains a scheme, percent-encoded entities are decoded. When
there's no scheme, all characters are left untouched.

Comparison of old and new behaviors:

URL                      drop_scheme()   hg.localpath()    url.localpath()
===                      =============   ==============    ===============
file://foo/foo           /foo            foo/foo           /foo
file://localhost:80/foo  /foo            localhost:80/foo  /foo
file://localhost:/foo    /foo            localhost:/foo    /foo
file://localhost/foo     /foo            /foo              /foo
file:///foo              /foo            /foo              /foo
file://foo               (empty string)  foo               /
file:/foo                /foo            /foo              /foo
file:foo                 foo             foo               foo
file:foo%23bar           foo%23bar       foo%23bar         foo#bar
foo%23bar                foo%23bar       foo%23bar         foo%23bar
/foo                     /foo            /foo              /foo

Windows-related paths on Windows:

URL                      drop_scheme()   hg.localpath()    url.localpath()
===                      =============   ==============    ===============
file:///C:/foo           C:/C:/foo       /C:/foo           C:/foo
file:///D:/foo           C:/D:/foo       /D:/foo           D:/foo
file://C:/foo            C:/foo          C:/foo            C:/foo
file://D:/foo            C:/foo          D:/foo            D:/foo
file:////foo/bar         //foo/bar       //foo/bar         //foo/bar
//foo/bar                //foo/bar       //foo/bar         //foo/bar
\\foo\bar                //foo/bar       //foo/bar         \\foo\bar

Windows-related paths on other platforms:

file:///C:/foo           C:/C:/foo       /C:/foo           C:/foo
file:///D:/foo           C:/D:/foo       /D:/foo           D:/foo
file://C:/foo            C:/foo          C:/foo            C:/foo
file://D:/foo            C:/foo          D:/foo            D:/foo
file:////foo/bar         //foo/bar       //foo/bar         //foo/bar
//foo/bar                //foo/bar       //foo/bar         //foo/bar
\\foo\bar                //foo/bar       //foo/bar         \\foo\bar

For more information about file:// URL handling, see:
http://www-archive.mozilla.org/quality/networking/testing/filetests.html

Related issues:

- issue1153: File URIs aren't handled correctly in windows

  This patch should preserve the fix implemented in
  5c92d05b064e. However, it goes a step further and "promotes"
  Windows-style drive letters from being interpreted as host names to
  being part of the path.

- issue2154: Cannot escape '#' in Mercurial URLs (#1172 in THG)

  The fragment is still interpreted as a revision or a branch, even in
  paths to bundles. However, when file: is used, percent-encoded
  entities are decoded, so file:test%23bundle.hg can refer to
  test#bundle.hg ond isk.
2011-03-30 20:03:05 -07:00
Brodie Rao
00a75e8663 hg: use url.url to parse branch names in parseurl() 2011-03-30 20:02:09 -07:00
Brodie Rao
9b6a7577e1 hg: look up schemes using url.url 2011-03-30 20:02:07 -07:00
Adrian Buehlmann
92624f7391 set NOT_CONTENT_INDEXED on .hg dir (issue2694)
when running on Windows
2011-03-28 15:54:22 +02:00
Peter Arrenbrecht
8f2d068a05 discovery: avoid discovery when local graph is a subset of remote
Immediately sends local's heads to the server to check whether the server knows them all.
If it does, we can call getbundle immediately.

Interesting test output changes are:

-  added 1 changesets with 0 changes to 1 files (+1 heads)
+  added 1 changesets with 0 changes to 0 files (+1 heads)

-> The new getbundle() actually fixes a bug vs. changegroupsubset() in that it no longer
returns unnecessary files when file revs are reused.

warning: repository is unrelated
+  requesting all changes

-> The new use of common instead of bases correctly indicates that an unrelated pull
gets all changes from the server.
2011-03-23 16:06:55 +01:00
Matt Mackall
9bb3fa8c69 merge with stable 2011-03-17 17:08:13 -05:00
Miloš Hadžić
b3d3d7aa76 push/outgoing: print remote target path even if there's an error (issue2561)
This is a simple patch to make hg push/hg outgoing print their remote target
path even if the operation fails. I'm not sure if the original behavior was by
design.

This patch also changes one test to reflect the changed behaviour.
2011-03-17 22:55:02 +01:00
David Soria Parra
d5ce5f0e0b hg: add support for cloning bookmarks 2011-03-13 12:24:17 +01:00
Mads Kiilerich
adb37b3b39 merge with stable 2011-01-28 03:09:22 +01:00
Mads Kiilerich
e10e504454 url: 'ssh known host'-like checking of fingerprints of HTTPS certificates
Known fingerprints of HTTPS servers can now be configured in the
hostfingerprints section. That makes it possible to verify the identify of web
servers without configuring and trusting the CA chain.

Limitations:
* Portnumbers are ignored, just like with ordinary certificates.
* Host name matching is case sensitive.
2011-01-28 02:57:59 +01:00
Eduard-Cristian Stefan
c66ec9cf09 url: expand path for web.cacerts 2011-01-02 15:30:12 +02:00
Martin Geisler
dc8a50e193 merge with stable 2011-01-05 15:56:03 +01:00
Mads Kiilerich
d9f11887ef https: use web.cacerts configuration from local repo to validate remote repo 2010-12-27 17:49:58 +01:00
Mads Kiilerich
2f015848bf merge with stable 2010-12-27 17:54:45 +01:00
Greg Ward
885d349b11 merge: document some internal return values. 2010-12-13 11:46:31 -05:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
Nicolas Dumazet
6b618a96de outgoing: unify common graphlog.outgoing and hg.outgoing code 2010-10-15 05:21:51 +02:00
Nicolas Dumazet
15e204f50d bundlerepo: unify common code into a new getremotechanges
The pattern where we fetch incoming remote changes and return
them as a local bundlerepo seems common. It's nicer to have this
code unified.
2010-10-14 22:41:43 +02:00
Nicolas Dumazet
171049119e incoming: unify code for incoming and graphlog.incoming 2010-10-14 21:36:00 +02:00
Nicolas Dumazet
631a3bb472 incoming: rename variable
Groundwork so that incoming and graphlog.incoming code look the same and get
easier to unify.
2010-10-14 21:37:00 +02:00
Erik Zielke
ddbd88fdcf incoming/outgoing: Fix recursion on sub repositories
Incoming and outgoing are fixed so they go through the whole three of
repositories instead of only visiting first level of sub repositories.
2010-09-24 12:00:55 +02:00
Brodie Rao
4be7b3bfc3 merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Without specifying the parent revision of the working copy, users will
update to tip, which is most likely the other head they were trying to
merge, not the revision they were at before the merge.
2010-09-12 18:05:53 -05:00
Martin Geisler
e849a4fa16 incoming: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:30 +02:00
Martin Geisler
d191f04663 outgoing: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:24 +02:00
Martin Geisler
c27c54faec clone, patch, convert: use hex(nullid) instead of '0'*40 2010-09-02 12:08:13 +02:00
Nicolas Dumazet
bd660e421e hg.clone: do not ignore branch argument when source is a repo object
This is a revert of f6aa66376f81. The "bug" mentioned in this changeset is unclear:
hopefully using a test to cover this usage should prevent any bugs.
2010-07-02 15:12:50 +09:00
Nicolas Dumazet
cd488569d7 hg.clone: fix branch value when passing a repo object (issue2267)
Since d6ca622d1122 the branch argument for addbranchrevs should be a tuple:
  (hashbranch, branches)
The right empty value therefore is (None, []) instead of None.
2010-07-02 15:05:21 +09:00
Sune Foldager
4e663d3541 improve --branch processing (and differentiate from # syntax)
Previously #foo and --branch foo were handled identically.
The behavior of #foo hasn't changed, but --branch now works like this:

1) If branchmap is not supported on the remote, the operation fails.
2) If branch is '.', substitute with branch of the working dir parent.
3) If branch exists remotely, its heads are expanded.
4) Otherwise, the operation fails.

Tests have been added for the new cases.
2010-06-10 12:46:09 +02:00
Matt Mackall
8ac0858186 Merge with stable 2010-06-08 15:57:59 -05:00
Sune Foldager
3577ed71f2 fix encoding bug in 66b9176ecbe4 2010-06-08 13:19:22 +02:00
Sune Foldager
ebb213954d push/pull: fix bug in "--branch ." handling
The branch wasn't expanded, so only the tip was operated on.
2010-06-07 16:28:23 +02:00
Sune Foldager
e0cc1e8ad9 merge with stable 2010-06-07 16:29:06 +02:00
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
Adrian Buehlmann
5f0d937313 clone: save hardlink state of util.copyfiles()
When trying to do hardlink-cloning, the os_link() call of the
first file tried already fails on Windows, if the source is on a
UNC path.

This change avoids calling os_link() for the rest of files, leaving
us with a *single* failed os_link() call per clone operation, if the
source can't do hardlinks.
2010-05-28 17:28:34 +02:00
Adrian Buehlmann
e782bd53a4 clone: print number of linked/copied files on --debug 2010-05-31 13:47:51 +02:00
Adrian Buehlmann
008aa04539 clone: save hardlink state of util.copyfiles()
When trying to do hardlink-cloning, the os_link() call of the
first file tried already fails on Windows, if the source is on a
UNC path.

This change avoids calling os_link() for the rest of files, leaving
us with a *single* failed os_link() call per clone operation, if the
source can't do hardlinks.
2010-05-28 17:28:34 +02:00
Matt Mackall
eb7971b34e Merge with stable 2010-05-11 17:03:44 -05:00
Brendan Cully
791f92f6bd Merge with stable 2010-03-18 14:36:24 -07:00
Sune Foldager
d6ef50d413 fix bug in hg.clone when passing in a repository object 2010-03-18 16:38:07 +01:00
Benoit Boissinot
3db7df2869 style: use consistent variable names (*mod) with imports which would shadow 2010-03-11 17:43:44 +01:00
Alexander Solovyov
f11ee5abee expand paths to local repository or bundle in appropriate classes
This avoids problem with unexpanded paths when it's not possible to
expand it at higher level (for example, if file:~/path/ is supplied as
path in schemes).
2009-12-07 12:31:45 +02:00
Sune Foldager
9fef9be505 addbranchrevs: fallback for older servers 2010-02-07 15:57:16 +01:00
Sune Foldager
3f138e6345 add -b/--branch option to clone, bundle, incoming, outgoing, pull, push 2010-02-07 15:23:46 +01:00
Sune Foldager
5020620fca interpret repo#name url syntax as branch instead of revision
Previously, the name part of an repo#name url was interpreted as a
revision, similar to using the --rev option. Now it is instead looked
up as a branch first, and if that succeeds all the heads of the branch
will be processed instead of just its tip-most head. If the branch
lookup fails, it will be assumed to be an revision as before (e.g. for
tags).
2010-02-07 14:29:07 +01:00
Sune Foldager
75a1470319 pull: with -u and -r, update to the first revision given
This makes pull consistent with clone. The actual change is in
mercurial.hg.parseurl, changing its checkout result, which is only
used for pull.
2010-02-06 20:24:51 +01:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Brendan Cully
9c496e1d92 share: use defaultdest to compute unspecified destination
This harmonizes with clone, and avoids creating a .hg in the current directory if
the source ends with a /
2009-12-19 22:55:33 -08:00
Matt Mackall
07d8da7a2f share: fix interaction with clone 2009-12-01 19:28:15 -06:00
Thomas Arendsen Hein
5490333861 Branch name printed since 00655544b9f3 now in local encoding. 2009-11-07 23:35:46 +01:00
Adrian Buehlmann
ba9637aae6 clone: add option -u/--updaterev 2009-11-05 11:05:13 +01:00
Adrian Buehlmann
a482b04850 hg.clone: report branch name on update 2009-10-16 23:57:34 +02:00
Stuart W Marks
928c430865 hg: say 'hg update' instead of 'hg up' in merge status message
Includes the change to the message itself, along with several test
output files that also had to change.
2009-09-17 22:39:38 -07:00
Martin Geisler
cc89e210eb hg: avoid combining translated strings
Combining translated string fragments into bigger strings is bad
practice because it removes context from the fragments. The translator
sees the fragments in isolation and might not jump back to the source
to see how a string like "%d files %s" is actually used.
2009-09-14 23:48:25 +02:00
Martin Geisler
235f78e4fb Merge with crew-stable 2009-09-04 23:34:51 +02:00
Matt Mackall
c34b180a9c Make distinct lookup error for localrepo.lookup
This allows clone/share to correctly distinguish lookup errors from
corruption errors and catch only the former.
2009-08-31 10:58:33 -05:00
Matt Mackall
2900a327ba Merge with i18n-stable 2009-08-12 12:06:12 -05:00
Matt Mackall
56469b1da7 update: make a naked except more specific (issue1766) 2009-07-25 19:04:08 -05:00
Matt Mackall
1dece1c619 Merge with stable 2009-08-12 12:07:11 -05:00
Matt Mackall
eba820848f Merge with crew 2009-07-27 18:38:20 -05:00
Martin Geisler
b61af83551 hg: better wrapping of string literal 2009-07-17 20:52:21 +02:00
Fred Wulff
affad77f81 Add (pre)outgoing hooks for local clones. 2009-04-17 16:34:43 -07:00
Matt Mackall
430046de97 subrepo: add update/merge logic 2009-06-15 02:45:38 -05:00
Matt Mackall
f004f8a57f share: allow dest to default to the basename of source 2009-06-13 18:16:44 -05:00
Matt Mackall
3132e79527 add helper function to create shared repos 2009-06-13 18:01:47 -05:00
Benoit Boissinot
13b1ecd60e clone: fall back to pull source repo cannot be locked, 039087cb3900 was a noop
039087cb3900 was a noop, it was missing the wait keyword
2009-05-28 17:44:57 +02:00
Brett Carter
d69cd3912f clone: try updating to the actual changeset specified in options
When cloning with the -r option or # url format from a tag the destination
repo most likely won't have the tag. We can save the lookup result to get to
the correct parent anyway. Similar to issue1306, but for tags.
2009-05-14 22:00:56 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
68db339c4b clone: config escaping no longer needed 2009-04-26 16:50:43 -05:00
Martijn Pieters
4abe231925 hg: allow hg.parseurl(url, None)
In many places hg.parseurl is called with a url and "opts.get('rev')",
suggesting the second, optional argument can be None. Because opts['rev']
usually defaults to [] this never happens in practice.

However, extensions don't necessarily behave the same, but do copy this
pattern.

Also, include wider hg.parseurl tests, beyond a demonstration of the problem.
2009-04-24 18:17:42 +02:00
Ronny Pfannschmidt
9c365a3b4f switch dircleanup in mercurial.hg.clone from gc based to explicit 2009-04-22 02:01:22 +02:00
Ronny Pfannschmidt
5356baa346 switch lock releasing in the core from gc to explicit 2009-04-22 02:01:22 +02:00
Steve Borho
63d4e6092c on clone failure, only remove directories we created
If the user created the clone target directory before running
the clone command, only cleanup the .hg/ repository when errors
occur.  Leave the empty target directory in place.
2009-03-31 21:21:53 -05:00
Steve Borho
ad54f46fa2 allow clone into existing but empty directories 2009-03-29 16:15:06 -05:00
Augie Fackler
bf90b0cbb4 merge: better error messages to lead users to hg update --clean to abandon merges.
Fixes issue1533.
2009-03-04 13:06:16 -06:00
Matt Mackall
76c90d50e6 error: move lock errors
rename LockException to LockError
2009-01-12 11:09:14 -06:00
Benoit Boissinot
abff8a39e9 add a comment about the need of hg._update() 2008-12-28 19:59:42 +01:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Dirkjan Ochtman
ba6b67f951 merge with crew-stable 2008-09-24 13:50:29 +02:00
Dirkjan Ochtman
fcf19417f1 clone: honor -r even when pulling named branches 2008-09-24 13:10:09 +02:00
Benoit Boissinot
66c79ea6b0 merge with -stable 2008-09-22 14:47:21 +02:00
Benoit Boissinot
0d1cd8705f Escape '%' when writing to hgrc (issue1199)
Fixes clone with paths containing '%'.
Patch provided by mjc.
2008-09-20 15:00:58 +02:00
Benoit Boissinot
5562ddda56 fix regression on empty repo cloning introduced by d87e43563bf4
The store directory wasn't copied. Unconditionally create the directories
instead.
2008-08-29 16:50:11 +02:00
Matt Mackall
3bf58ba630 clone: get a list of files to clone from store 2008-08-13 20:18:44 -05:00
Bryan O'Sullivan
369f2e957f repo: add rjoin method 2008-04-11 22:19:52 -07:00
Bryan O'Sullivan
6676f1cebf parseurl: make revs optional 2008-04-11 22:19:51 -07:00
Bryan O'Sullivan
99462bd4ec Hoist localpath to the top level 2008-04-11 22:18:38 -07:00
Matt Mackall
edf5a0f5d0 resolve: new command
- add basic resolve command functionality
- point failed update and merge at resolve
2008-04-11 12:52:56 -05:00
Adrian Buehlmann
153675561e clone: print "updating working directory" status message
With this change, "hg clone" looks like this:

% hg clone http://example.com/repo/big big
requesting all changes
adding changesets
adding manifests
adding file changes
added XXX changesets with XXX changes to XXX files
updating working directory
XXX files updated, XXX files merged, XXX files removed, XXX files unresolved

So the user sees

% hg clone http://example.com/repo/big big
requesting all changes
adding changesets
adding manifests
adding file changes
added XXX changesets with XXX changes to XXX files
updating working directory

while Mercurial is writing to disk to populate the working directory

With this change, "hg clone" looks like this:

% hg clone big big-work
updating working directory
XXX files updated, XXX files merged, XXX files removed, XXX files unresolved
2008-03-21 14:52:24 +01:00
Matt Mackall
0dec779241 clone: use cancopy 2008-03-20 11:12:35 -05:00
Joel Rosdahl
c26213193c Avoid importing mercurial.node/mercurial.repo stuff from mercurial.hg 2008-03-06 22:51:16 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Thomas Arendsen Hein
94ab532ffb Allow "file://localhost/" in addition to "file:///" (issue728)
file://localhost/ URLs are generated by Mac OS X API calls like
[NSURL fileURLWithPath:].

Imported patch from Paul Bx.
2008-02-22 21:58:15 +01:00
Alexis S. L. Carvalho
ffa3574a24 merge with crew-stable 2008-02-13 19:34:28 -02:00
Alexis S. L. Carvalho
b7de0fe439 clone: make things work when source is a repo object 2008-02-13 18:37:38 -02:00
Alexis S. L. Carvalho
d7bfbe69bb clone: expand the path before saving it in .hg/hgrc
This should fix issue976
2008-02-13 18:37:38 -02:00
Patrick Mezard
3cc8f21213 hg: fail upon copy/link errors while cloning locally 2007-12-27 22:28:41 +01:00
Matt Mackall
ad0a02c7c8 merge: make return codes more sensible
Commands that call merge were exiting with a return code equal to the
number of unresolved files. We now return 1 if there are unresolved
files.
2007-12-10 10:24:14 -06:00
Matt Mackall
6a1dd997b2 clone: fix race with same target directory (issue716)
Whichever side creates .hg first wins the race, and the other aborts
politely without deleting the tree.
2007-12-02 13:37:30 -06:00
Benoit Boissinot
e0d07dc91a merge with crew 2007-08-31 23:15:44 +02:00
Benoit Boissinot
5025962412 merge with crew-stable 2007-08-31 22:31:43 +02:00
Benoit Boissinot
5e4804df51 fix the dummy 00changelog.i not being copied on clone 2007-08-31 22:31:03 +02:00
Alexis S. L. Carvalho
714fa94597 Merge with crew-stable 2007-08-27 02:21:58 -03:00
Alexis S. L. Carvalho
b7234419e2 clone: remove "file://" before making the path absolute
This avoids writing bogus paths to .hgrc.  Fixes issue695.
2007-08-27 01:44:35 -03:00
Alexis S. L. Carvalho
616367be9a clone: if "url#rev" was given, update to rev 2007-08-27 01:44:35 -03:00
Alexis S. L. Carvalho
88d2731fa8 parseurl: also return the revision after the "#"; add a test 2007-08-27 01:44:35 -03:00
Alexis S. L. Carvalho
dc23a7db18 Move cmdtable and reposetup handling out of extensions.py
A new function (extensions.extensions) allows the code that is
interested in those attributes to handle them directly.

This allows some cleanups of extensions.py.  Notably, we can
remove the extensions.commandtable hack.

It also makes it easier to add standard extension attributes,
like a "hgwebsetup" function or a "helptable" dict that augments
the data in help.py, etc.
2007-08-17 17:33:27 -03:00
Matt Mackall
7065cf1716 Merge with crew 2007-08-17 00:35:16 -05:00
Benoit Boissinot
0369364273 merge with -stable 2007-08-17 00:43:49 +02:00
Benoit Boissinot
c012edc900 clone: do not delete the target if only the update fails 2007-08-17 00:42:22 +02:00
Matt Mackall
1d9daf6473 move parseurl from cmdutil to hg 2007-08-15 16:10:36 -05:00
Matt Mackall
3a3bd8ec5b Make repo locks recursive, eliminate all passing of lock/wlock 2007-07-21 16:02:10 -05:00
Matt Mackall
3e13c68628 Use try/finally pattern to cleanup locks and transactions 2007-07-21 16:02:10 -05:00
Thomas Arendsen Hein
d486a44410 Removed deprecated hg:// and old-http:// protocols (issue406) 2007-07-08 09:54:42 +02:00
Matt Mackall
dc9134201b extensions: untangle some recursive dependencies 2007-07-05 15:37:23 -05:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
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