Commit Graph

544 Commits

Author SHA1 Message Date
David M. Carr
7168922e8f gitrepo: initial support for listkeys
This changeset adds test coverage for comparing "hg outgoing -B" in normal
Mercurial usage with Hg-Git usage.  This didn't match, since previously, gitrepo
didn't provide a meaningful listkeys implementation.  Now, it does.

gitrepo now has access to a GitHandler when a localrepo is available.  This
handler is used to access the information needed to implement listkeys for
namespaces (currently, only bookmarks) and bookmarks.

A couple of other tests were testing "divergent bookmark" scenarios.  These
tests have been updated to filter out the divergent bookmark output, as it isn't
consistent across the supported Mercurial versions.
2012-10-25 20:49:08 -04:00
David M. Carr
7cbc08a5a2 peer: pass localrepo to new gitrepo instances
This change wraps hg.peer to allow for capturing the repo object.  It is then
passed in to new gitrepo instanceds.  This will be needed to implement later
functionality, such as richer bookmark support using pushkeys.
2012-10-25 19:54:05 -04:00
David M. Carr
92f7dd666e push: fix traceback when pushing empty hg repo to empty git repo (issue #58)
In the logic that was attempting to handle the case where the local repo doesn't
have any bookmarks, the assumption was being made that tip resolved to a
non-null revision.  In the case of a totally empty local repo, however, that
isn't a valid assumption, and resulted in attempting to set the master ref
to None, which broke dulwich.

The "fix", which avoids the traceback and allows the push to complete (though
still do nothing, since in this case there aren't any changes to push), is to
not tweak the refs at all if tip is nullid.  Leaving the special capabilities
ref and not adding a master ref appears to be fine in this case.
2012-10-25 00:40:35 -04:00
Augie Fackler
9f2907f1f1 Merge 2012-10-17 10:59:42 -05:00
Augie Fackler
f8e6ed57b8 git_handler: lazy-load mapping
Loading the mapping was costing about half a second for a user on IRC
on the pidgin repo. There's no reason to load this data aggressively.
2012-10-17 10:50:55 -05:00
David M. Carr
deeefd08e1 tests: add workflow coverage for push with no changes
test-bookmark-workflow.t now skips all Mercurial versions below 2.1, as the
return code is different, and it's more important for this test to accurately
show that we match the behavior of current Mercurial than that all versions
behave the same.
2012-10-07 20:19:51 -04:00
David M. Carr
33ac80b524 push: change "no changes" default output to match normal mercurial
The output for "hg push" when there were no changes didn't quite match between
Mercurial with and without Hg-Git, so I changed the behavior to bring it into
synch.  The existing "creating and sending data" message was changed to be
included if --verbose is specified.
2012-10-07 20:11:27 -04:00
David M. Carr
9437452e31 tests: add coverage for outgoing with no changes 2012-10-07 19:58:24 -04:00
David M. Carr
d1fdf13545 tests: add coverage for bookmark workflow comparison; cloning 2012-10-07 19:48:51 -04:00
David M. Carr
ca11f771fb tests: fix test-subrepos.t sporadically failing
I was seeing sporadic failures running this test on Mac OS X 10.8.
They looked like this:
+  sed: 1: "s_/private/var/folders/ ...": bad flag in substitute command: 'T'

My assumption is that some character was being included in the path of the
temporary directory that sed didn't like.  It looks like the sed function was
being used to eliminate differences between test runs due to the path changing
each run.  That isn't needed any more now that we're using the unified test
format, since said replacement is taken care of for us by run-tests.py.  Thus,
this changeset removes the calls to sed and updates the output to use the result
from the framework-level replacement.
2012-10-07 19:37:59 -04:00
David M. Carr
cf59f5739c docs: include testedwith
Mercurial has support for including information about the tested versions of
Mercurial for an extension when it detects that an extension has broken.  This
change includes the appropriate attribute in the extension.
2012-09-27 22:52:54 -04:00
David M. Carr
37995f7c6c docs: include buglink
Mercurial has support for including a link to an issue tracker when it detects
that an extension has broken.  This change includes the appropriate attribute
in the extension, pointing it at the issue tracker for the main BitBucket repo.
2012-09-27 22:42:41 -04:00
David M. Carr
727eff8e96 outgoing: don't delete remote refs
There was a bug introduced in fa5f235be2cd such that calling hg outgoing on
a Git repository would result in all refs being deleted from the remote
repository (with the possible exception of the currently checked out branch).
It wasn't noticed before because the existing test for outgoing didn't actually
verify the refs on the remote.  This changeset fixes the bug, as well as adding
test coverage to allow verifying that the fix works.
2012-09-27 22:32:01 -04:00
Gregory Szorc
2d6677065b Verify tree and parent objects are in Git repo
When exporting Git commits, verify that the tree and parents objects
exist in the repository before allowing the commit to be exported. If a
tree or parent commit is missing, then the repository is not valid and
the export should not be allowed.
2012-09-21 20:26:26 -07:00
Gregory Szorc
2e7c57f121 Precompile author file regular expression 2012-09-21 19:43:50 -07:00
Gregory Szorc
a8e43072e2 Precompile Git progress regular expressions 2012-09-21 19:42:24 -07:00
Gregory Szorc
19caaa42b9 Precompile Git author extra data regular expression 2012-09-21 19:39:53 -07:00
Gregory Szorc
71b136cd70 Precompile Git username sanitizing regular expression 2012-09-21 19:36:57 -07:00
Gregory Szorc
029f0a2090 Precompile Git URI regular expression 2012-09-21 19:32:16 -07:00
Gregory Szorc
7ac8f5932a Optimize get_git_author
Pre-compile regular expression. Prevent extra key lookup in author_map.
2012-09-21 19:28:46 -07:00
Sean Farley
c8782ecead setup: fix typo forgetting brackets introduced in 31e7e1b0cf18 2012-09-16 14:46:18 -05:00
David M. Carr
559f12d7a8 tests: remove use of git-daemon in test-subrepos
This change was already applied to all the other tests.
2012-09-14 19:10:18 -04:00
David M. Carr
364a71f9b9 tests: remove piping of command git init from test-subrepos
This change was already applied to all the other tests.
2012-09-14 19:10:05 -04:00
David M. Carr
e024c30fb0 tests: remove configuration of bookmarks extension from test-subrepos
This change was already applied to all the other tests.
2012-09-14 19:09:42 -04:00
David M. Carr
c6032be868 tests: unify test-subrepos 2012-09-14 19:08:51 -04:00
Augie Fackler
b4c0cfe688 test-subrepos: fix test to actually pass against all supported versions 2012-09-14 14:09:25 -05:00
David M. Carr
e7b625ba6a docs: update to correctly reflect that local git repositories are supported 2012-09-13 20:57:37 -04:00
David M. Carr
f6564520bb tests: eliminate use of git-daemon
Dulwich now supports local repositories just fine.  Not using the daemon makes
the tests easier to read and more reliable (less likely to be skipped because
a stray daemon is holding onto the port).
2012-09-13 20:49:45 -04:00
David M. Carr
77a9e3062f tests: remove piping of command git init to remove leading path
In many cases we were piping to a python script to strip out the varying leading
path to the test repos.  This is no longer needed, as the modern run-test.py
automatically substitutes the leading path as $TESTTMP.  Eliminating the piping
makes the tests easier to read and write, as well as allowing the exit codes
to be verified by the test.
2012-09-13 20:49:42 -04:00
David M. Carr
91ca9b4626 tests: remove configuration of bookmarks extension
All of our supported Hg versions include bookmarks in core.  Thus, actovating
it in the hgrc and setting bookmarks.track.current are no longer needed.
2012-09-13 20:48:11 -04:00
David M. Carr
88a61af51d readme: remove references to bookmarks being optional 2012-09-13 20:36:58 -04:00
David M. Carr
8fd7357cd1 tests: drop test-sane-without-bookmarks
Since bookmarks become a core feature in Hg 1.8, and our minimum supported
version is now greater than that, the test is skipped for all supported
versions.
2012-09-13 18:50:21 -04:00
David M. Carr
56b2e2b8e6 tests: unify test-outgoing 2012-09-13 18:48:46 -04:00
David M. Carr
523efe6ee9 outgoing: re-introduce support for outgoing 2012-09-13 18:47:11 -04:00
David M. Carr
4d4c6edc52 makefile: remove support for hg before 1.9.3
Versions removed are 1.7.5 and 1.8.4.
These versions use findoutgoing for discovery, rather than the more modern
findcommonoutgoing.
2012-09-13 18:45:46 -04:00
David M. Carr
4d955a013e dulwich: require 0.8.6 or greater 2012-09-13 18:43:05 -04:00
Augie Fackler
3ee9490c5b test-subrepos: fix up test now that it's executable 2012-09-13 09:36:24 -05:00
Augie Fackler
2456183e1f Merge more test cleanups from David. 2012-09-13 09:19:38 -05:00
Augie Fackler
76a700ffe5 test-git-submodules: update expected output 2012-09-13 09:17:46 -05:00
David M. Carr
36db5b353a tests: make test-subrepos executable
Previously, I was getting this message when running tests:

Skipped test-subrepos: not executable
2012-09-11 23:16:15 -04:00
David M. Carr
2b053b0765 tests: unify test-encoding 2012-09-11 18:51:19 -04:00
David M. Carr
8d1a9d21db tests: unify test-tree-decomposition 2012-09-10 00:28:05 -04:00
David M. Carr
ac8d2d8bac tests: unify test-sane-without-bookmarks 2012-09-10 00:27:57 -04:00
David M. Carr
0bbf714c18 tests: unify test-push-r 2012-09-10 00:27:56 -04:00
David M. Carr
ecd8836801 tests: unify test-push 2012-09-10 00:27:45 -04:00
David M. Carr
4665bf2530 tests: unify test-pull-after-strip 2012-09-10 00:27:44 -04:00
David M. Carr
89919e98b2 tests: unify test-pull 2012-09-10 00:27:43 -04:00
David M. Carr
4acf2aa1b4 tests: unify test-octopus 2012-09-10 00:27:41 -04:00
David M. Carr
4672de85cd tests: unify test-merge 2012-09-10 00:27:33 -04:00
David M. Carr
aa31bde6e3 tests: unify test-incoming 2012-09-10 00:27:32 -04:00