Commit Graph

21 Commits

Author SHA1 Message Date
Siddharth Agarwal
178e6c9bdb overlaychangectx: use overlayrevlog logic to determine parents
The old logic was broken -- it didn't work at the boundary between hg and git
commits. The logic in overlayrevlog.parents handles that correctly.

This is the last fix required for Mercurial 3.4.
2015-05-08 15:50:48 -07:00
Siddharth Agarwal
fa1f56923a overlay: adapt diff to work with lazymanifests 2015-05-08 16:00:45 -07:00
Sean Farley
7f080a40f6 overlay: flake8 cleanup 2015-04-22 16:41:38 -07:00
Sean Farley
76f530f942 overlay: remove method that apparenetly was never called
This method had a syntax error that would have caused a crash.
2015-04-22 16:40:45 -07:00
Siddharth Agarwal
830312cb5f overlaychangectx: return nullrev if commit has no parents
In Mercurial, every commit has at least one parent -- root commits have the
null revision as their parent. In Git, root commits don't have any parents.
This difference needs to be papered over in hg-git for 'hg incoming' to work in
Mercurial 3.4+.

Note that this doesn't fix all the broken tests in default -- I haven't had
time to investigate the others.
2015-04-03 11:18:30 -07:00
Siddharth Agarwal
a5d4fa20cb overlaymanifest: implement more methods for Mercurial 3.3 compatibility
Looks like we use many more dict APIs in overlaymanifest.
2015-01-26 17:47:54 -08:00
Siddharth Agarwal
61d715d7f4 overlaychangelog: return tuples for read()
I have no idea why this used to return a changectx -- changelog.read() in core
has always returned a tuple.
2015-01-26 17:46:55 -08:00
Siddharth Agarwal
f36dda4433 overlay: add namespace support to overlayrepo to support Mercurial >= 3.3
This allows test-incoming.t to progress further.
2015-01-26 16:21:23 -08:00
Durham Goode
6a97baea46 manifest: add matches() to overlay
fd926a0f2592 in upstream Mercurial added a matches function to the manifest.
This broke 'hg incoming -p' with hg-git. This patch adds a simple implementation
that fixes the problem.

This was caught by the tests, and now the tests pass.
2014-11-25 10:53:11 -08:00
Siddharth Agarwal
bbfc3bf8b0 overlayrevlog: handle root commits correctly
Previously, we'd try to access commit.parents[0] and fail. Now, check for
commit.parents being empty and return what Mercurial thinks is a repository
root in that case.
2014-02-25 00:23:12 -08:00
Siddharth Agarwal
a5e956514d overlayrevlog: handle rev = 0 correctly
Previously we'd just test if gitrev was falsy, which it is if the rev returned
is 0, even though it shouldn't be. With this patch, test against None
explicitly.

This unmasks another bug: see next patch for a fix and a test.
2014-02-25 00:20:22 -08:00
Siddharth Agarwal
01896282f6 overlay: drop support for Mercurial < 1.9 2014-02-19 18:46:56 -08:00
Augie Fackler
58fd252e1f overlay: add kludge to make sure we only ever give hexshas to dulwich 2013-12-13 12:54:39 -05:00
Augie Fackler
29a7a3aee8 overlays: fix incoming support for hg 2.8
This was crafted mostly via a bunch of aimless flailing in the
code. I'm pretty well convinced at this point that the incoming
support needs to be rewritten slightly to behave properly in the new
world order (specifically, the overlayrepo class probably should be
subclassing localrepo, or else more directly reimplementing things
instead of trying to forward methods.)
2013-10-05 17:40:50 -04:00
Augie Fackler
66478492e0 overlaymanifest: add iteritems(), used by recent hg versions 2013-04-03 14:37:13 -05:00
Augie Fackler
76a939ac4f Merge obsolete marker fix. 2012-10-29 21:34:37 -05:00
David M. Carr
ceacd986b2 overlaychangectx: fix compatibility with mercurial 2.4-rc (no attribute _repo)
This isn't a real implementation of phases support.  Rather, it's just enough
to avoid the traceback.

Traceback (most recent call last):
  File "/usr/local/share/python/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 65, in dispatch
    return _runcatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 88, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 741, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 514, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 831, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 802, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 738, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 472, in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line 3942, in incoming
    return hg.incoming(ui, repo, source, opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 525, in incoming
    return _incoming(display, subreporecurse, ui, repo, source, opts)
  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 494, in _incoming
    displaychlist(other, chlist, displayer)
  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 524, in display
    displayer.show(other[n])
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 670, in show
    self._show(ctx, copies, matchfn, props)
  File "/usr/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 691, in _show
    label='log.changeset changeset.%s' % ctx.phasestr())
  File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 203, in phasestr
    return phases.phasenames[self.phase()]
  File "/usr/local/lib/python2.7/site-packages/mercurial/context.py", line 201, in phase
    return self._repo._phasecache.phase(self._repo, self._rev)
AttributeError: 'overlaychangectx' object has no attribute '_repo'
2012-10-29 20:16:00 -04:00
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
Augie Fackler
15e2601c3a overlaymanifest: add the withflags method introduced in hg change 3f7abfd06d2d 2012-07-26 18:59:19 -05:00
Augie Fackler
bad8d98927 overlay: stop using deprecated tree.entries() method 2011-09-09 13:44:58 -05:00
Brendan Cully
95c74ae913 Support for hg incoming 2011-05-24 11:16:45 -07:00