Commit Graph

25 Commits

Author SHA1 Message Date
Siddharth Agarwal
34580646fc exchange: wrap push if localrepository.push isn't available
Mercurial rev 88d9d4ec499e removed localrepository.push. We don't do it the
other way round (wrap push if exchange.push is available) because that's been
available with a different signature since Mercurial 3.0.
2014-10-13 18:55:18 -07:00
Siddharth Agarwal
3d8689ca46 exchange: wrap pull if localrepository.pull isn't available
Mercurial rev 20bb6e6b4dc5 removed localrepository.pull. We don't do it the
other way round (wrap pull if exchange.pull is available) because that's been
available with a different signature since Mercurial 3.0.
2014-10-13 18:53:42 -07:00
Siddharth Agarwal
16e7862fe1 hgrepo: move _transform_notgit into util
This decorator will be used in other contexts in upcoming patches.
2014-10-13 16:26:31 -07:00
Siddharth Agarwal
58d56b6660 hgrepo: import mercurial.util as hgutil
An upcoming patch will import hg-git's util. This particular pattern is
followed throughout the hg-git codebase.
2014-10-13 16:26:23 -07:00
Siddharth Agarwal
71fe850624 hgrepo: move remote ref loading to git_handler
The writing out is in the git handler, so the loading should be too.
2014-09-03 19:46:42 +02:00
Siddharth Agarwal
043b7dbe03 git_handler: move git-remote-refs out to a class field for consistency 2014-09-03 18:48:16 +02:00
Augie Fackler
f454e245e4 hgrepo: catch NotGitRepository and turn it into abort 2014-08-23 12:35:57 -04:00
Siddharth Agarwal
8f2d697a54 hgrepo.tags: drop support for Mercurial < 2.0
A new property called _tagscache was introduced in Mercurial 2.0, so the cache
wasn't actually working.

The contract for tags() also changed at some point -- it stopped returning
nodes that weren't in the repo. This will need to be accounted for if we
start using the tags cache again. However, it isn't very clear whether the
Mercurial tags cache is actually worth doing, since we already have a
separate in-memory cache for Git tags in the handler.
2014-02-19 16:09:23 -08:00
Siddharth Agarwal
41357ce554 hgrepo.push: drop support for Mercurial < 1.6 2014-02-19 15:55:45 -08:00
Siddharth Agarwal
772133c48a hgrepo.tags: use githandler property
Currently we call hgrepo.tags() separately for each tag. (This should be fixed
at some point.) This avoids initializing a separate git handler for each tag.

For a repository with over 150 tags, this brings down a no-op hg pull by 0.05
seconds.
2014-02-19 14:16:40 -08:00
Siddharth Agarwal
232c6612ae hgrepo._findtags: use githandler property 2014-02-19 14:15:33 -08:00
Siddharth Agarwal
1c6dc044d5 hgrepo.findoutgoing: use githandler property 2014-02-19 14:14:54 -08:00
Siddharth Agarwal
f87f28dc3a hgrepo.push: use githandler property 2014-02-19 14:14:01 -08:00
Siddharth Agarwal
63f40c5059 hgrepo.pull: use githandler property 2014-02-19 14:12:38 -08:00
Siddharth Agarwal
728f8df8de hgrepo: expose git handler as a property
This and upcoming patches have the goal of initializing a GitHandler just once
for a Mercurial repo.
2014-02-19 14:12:03 -08:00
David M. Carr
fb9384235f push: return 1 if no changes found, 0 if success
While working on some other tests, I noticed that the push command was returning
exit code 1 on success.  This changeset makes hgrepo.push use the same return
code contract as localrepo.push, which makes the exit codes behave as expected.
2012-09-05 23:27:31 -04:00
Toshi MARUYAMA
2833d729d3 hgrepo: fix _findtags changes on Mercurial 2.2 2012-07-08 16:10:23 +09:00
Adrian Sampson
4fa25100ed respect references to tags that differ between git and .hgtags 2011-05-20 22:41:43 -07:00
Adrian Sampson
8c05238aa7 use new names for tags cache attributes if they're available 2011-05-20 22:36:06 -07:00
Brendan Cully
a36df4d3a1 Make pull results more like hg pulls.
Returns the number of changed heads (refs).
Uses the same "no changes found" message.
2011-05-18 15:12:32 -07:00
Augie Fackler
6e81a1af77 hgrepo: completely rework handing of remote refs marking
Previously, we appended to .hg/localtags on every pull. This meant
that we never deleted refs that disappeared on the remote server, and
the file length grew without bound. Now we use our own file
(.hg/git-remote-refs) and we do prune refs that disappear from the
remote server.
2010-12-20 22:37:07 -06:00
Augie Fackler
c13e8ed89d tests: import test-push-r (with slight changes) from Mercurial
This lets us detect defects in our wrappers which would break
Mercurial when working against normal hg repositories with hg-git
enabled.
2010-08-15 09:45:00 -05:00
Augie Fackler
d421c65e08 hgrepo: pass through newbranch arg if pushing to hg 2010-06-18 08:20:47 -05:00
Augie Fackler
b6ff51f6c0 push: handle argspec change from a00aac92bfb9 2010-06-12 21:12:21 -05:00
Kevin Bullock
25a2b1d0a1 package with distutils
(patch tweaked slightly by Augie Fackler)
2009-09-30 14:39:49 -05:00