Joe Pallas | 5 Oct 2009 09:16
Picon

Cloning issue with strange SVN revision


I tried to clone a repository that apparently has some kind of odd
revision in it (the result of some surgery someone did to move stuff
from one repository to another, I believe).  This revision seems to,
well, not really exist: svn log shows an entry for n-1 and n+1, for
example, but no revision n.

I got this exception when the odd revision was being processed:
File "/Users/Shared/hgsubversion/hgsubversion/wrappers.py", line 254,
in pull
    msg = r.message.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

I notice that this code was changed in 612b8d753549.  The previous
code had a try wrapped around the strip

    try:
        msg = [s for s in map(str.strip, r.message.splitlines()) if s]
[0]
    except:
        msg = default_commit_msg

while the newer code looks like

                        msg = r.message.strip()
                        if not msg:
                            msg = util.default_commit_msg
                        else:
                            msg = [s.strip() for s in msg.splitlines()
if s][0]
(Continue reading)

Augie Fackler | 5 Oct 2009 16:47
Picon
Gravatar

Re: Cloning issue with strange SVN revision



On Mon, Oct 5, 2009 at 2:16 AM, Joe Pallas <joe.pallas <at> gmail.com> wrote:

I tried to clone a repository that apparently has some kind of odd
revision in it (the result of some surgery someone did to move stuff
from one repository to another, I believe).  This revision seems to,
well, not really exist: svn log shows an entry for n-1 and n+1, for
example, but no revision n.

Is it possible that revision n simply occurred in a path that isn't inside your project? Try doing svn log -r n at the repository root. If you still see no revision n at the repo root, you probably have a corrupt repository. 
 
I got this exception when the odd revision was being processed:
File "/Users/Shared/hgsubversion/hgsubversion/wrappers.py", line 254,
in pull
   msg = r.message.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

I notice that this code was changed in 612b8d753549.  The previous
code had a try wrapped around the strip

   try:
       msg = [s for s in map(str.strip, r.message.splitlines()) if s]
[0]
   except:
       msg = default_commit_msg

while the newer code looks like

                       msg = r.message.strip()
                       if not msg:
                           msg = util.default_commit_msg
                       else:
                           msg = [s.strip() for s in msg.splitlines()
if s][0]

I'm not familiar with the svn wrappers, so I don't know if it is
reasonable for r.message to be None in this case, but it looks like
the old code handled that case and the newer code does not.  Can
anyone say whether it is reasonable to change this to handle a non-
existent message?

I just asked, and it's possible (although unlikely) for the svn log message revprop to be None, so we definitely need to handle that case. I'd welcome a patch for that (with a test, otherwise it's likely to regress).
 

Thanks.
joe




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.com/group/hgsubversion?hl=en
-~----------~----~----~----~------~----~------~--~---

lwi | 5 Oct 2009 17:37
Picon

failed to import extension svn on mac os x


Hello,

I installed mercurial binary packages from mercurial site built for
snow leopard(1.3.1).
It is installed at /Library/Python/2.6/site-packages/mercurial.

I tried the following to check svn from python command line:

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn
>>> print svn.__file__

/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/
python/svn/__init__.pyc

So it seems fine.

I installed hgsubversion at /Library/Python/2.6/site-packages (near
mercurial).
I set .hgrc to look for hgsubversion to /Library/Python/2.6/site-
packages/hgsubversion.

And I have the following error when trying hgsubversion :

*** failed to import extension svn from /Library/Python/2.6/site-
packages/hgsubversion: No module named hgsubversion
hg: unknown command 'svnclone'

Someone show similar problem using virtualenv :
http://codersbuffet.blogspot.com/2009/09/mercurial-subversion-and-virtualenv.html

Since i am not using virtualenv, i can't use virtualenvwrapper.

What is my problem please ? Is virtualenv the only solution ?

Thanks for your attention.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To post to this group, send email to hgsubversion@...
To unsubscribe from this group, send email to hgsubversion+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/hgsubversion?hl=en
-~----------~----~----~----~------~----~------~--~---

lwi | 6 Oct 2009 17:58
Picon

Re: failed to import extension svn on mac os x


Hi,

I resolved my poblem.

I found the solution in this post :
http://cecinestpasun.com/entries/getting-hgsubversion-work-under-osx/

The solution was to change in .hgrc :
svn=/Library/Python/2.6/site-packages/hgsubversion

into

svn=/Library/Python/2.6/site-packages/hgsubversion/hgsubversion

The info on the page
http://bitbucket.org/durin42/hgsubversion/src/tip/hgsubversion/
was misleading saying :
"If you are unfamiliar with installing Mercurial extensions, please
see the UsingExtensions page in the Mercurial wiki. Look at the
example for specifying an absolute path near the bottom of the page.
You want to give the path to the top level of your clone of this
repository."

So the conclusion is that on mac os x 10.6 (snow leopard), it is very
easy to install (just mercurial mac package from selenic page and
clone hgsubversion).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To post to this group, send email to hgsubversion@...
To unsubscribe from this group, send email to hgsubversion+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/hgsubversion?hl=en
-~----------~----~----~----~------~----~------~--~---

Augie Fackler | 6 Oct 2009 18:05
Picon
Gravatar

Re: failed to import extension svn on mac os x

Sorry, the readme is out of date. I'll get that fixed shortly.


Alternatively, you can do "python setup.py install" in the hgsubversion clone, which will actually install hgsubverison instead of running it from the clone. After that, you can just do
hgsubversion=
in your extension configuration instead of specifying a full path.

On Tue, Oct 6, 2009 at 10:58 AM, lwi <louis.foucart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hi,

I resolved my poblem.

I found the solution in this post :
http://cecinestpasun.com/entries/getting-hgsubversion-work-under-osx/

The solution was to change in .hgrc :
svn=/Library/Python/2.6/site-packages/hgsubversion

into

svn=/Library/Python/2.6/site-packages/hgsubversion/hgsubversion

The info on the page
http://bitbucket.org/durin42/hgsubversion/src/tip/hgsubversion/
was misleading saying :
"If you are unfamiliar with installing Mercurial extensions, please
see the UsingExtensions page in the Mercurial wiki. Look at the
example for specifying an absolute path near the bottom of the page.
You want to give the path to the top level of your clone of this
repository."

So the conclusion is that on mac os x 10.6 (snow leopard), it is very
easy to install (just mercurial mac package from selenic page and
clone hgsubversion).




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.com/group/hgsubversion?hl=en
-~----------~----~----~----~------~----~------~--~---

Matt Joiner | 17 Oct 2009 01:43
Picon
Gravatar

Re: Development activity and Python PEP 385


Thanks for the feedback, I'm looking forward to Python's shift to Hg.
I sympathise with the lack of spare time completely, I'm under similar
duress.

Sincerely,
Matt.

On Sep 25, 12:52 am, Dirkjan Ochtman <dirk...@...> wrote:
> On Thu, Sep 24, 2009 at 07:40, Matt Joiner <anacro...@...> wrote:
> > I noticed in PEP 385 draft that the Python team is considering
> > conversion to Mercurial when the hgsubversion library has progressed
> > more, from early August. There has however not been any activity in
> > hgsubversion from that time. What is the status of this project?
>
> I am the author of that PEP, and I've gotten back to working on
> hgsubversion lately. Augie has just pushed a fix for an issue Brett
> Cannon discovered when working with my conversion, and I am looking at
> fixing more issues for both Python and Jython (who have said they'd
> like to convert sooner than Python). Meanwhile, I've tested
> hgsubversion on a bunch of other repositories in my regular use of
> OSS, and it's been working fine.
>
> Cheers,
>
> Dirkjan

hgsubversion | 17 Oct 2009 05:50

6 new revisions pushed by durin42 on 2009-10-17 03:49 GMT


6 new revisions:

Revision: 6eea269ff1
Author: Augie Fackler <durin42@...>
Date: Wed Oct  7 16:05:01 2009
Log: stupid: remove stray print statements, keep one as a ui.debug
http://code.google.com/p/hgsubversion/source/detail?r=6eea269ff1

Revision: 44bde69b6c
Author: Augie Fackler <durin42@...>
Date: Wed Oct  7 15:27:35 2009
Log: stupid: detect renames with empty branchpath properly
http://code.google.com/p/hgsubversion/source/detail?r=44bde69b6c

Revision: 5e0dfe59d4
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 16:09:25 2009
Log: copies: fix under-reporting of copies in hg
http://code.google.com/p/hgsubversion/source/detail?r=5e0dfe59d4

Revision: cad864ed29
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 16:09:53 2009
Log: util: make aresamefiles take one file and just be issamefile instead.
http://code.google.com/p/hgsubversion/source/detail?r=cad864ed29

Revision: 990e07054f
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 15:37:19 2009
Log: replay: fix potential over-reporting of edited files in hg changelog
http://code.google.com/p/hgsubversion/source/detail?r=990e07054f

Revision: 1fd3cfa47c
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 20:33:41 2009
Log: Support for single-directory clones.
http://code.google.com/p/hgsubversion/source/detail?r=1fd3cfa47c

==============================================================================
Revision: 6eea269ff1
Author: Augie Fackler <durin42@...>
Date: Wed Oct  7 16:05:01 2009
Log: stupid: remove stray print statements, keep one as a ui.debug
http://code.google.com/p/hgsubversion/source/detail?r=6eea269ff1

Modified:
  /hgsubversion/stupid.py

==============================================================================
Revision: 44bde69b6c
Author: Augie Fackler <durin42@...>
Date: Wed Oct  7 15:27:35 2009
Log: stupid: detect renames with empty branchpath properly
http://code.google.com/p/hgsubversion/source/detail?r=44bde69b6c

Modified:
  /hgsubversion/stupid.py

==============================================================================
Revision: 5e0dfe59d4
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 16:09:25 2009
Log: copies: fix under-reporting of copies in hg
http://code.google.com/p/hgsubversion/source/detail?r=5e0dfe59d4

Modified:
  /hgsubversion/editor.py
  /hgsubversion/stupid.py
  /tests/test_fetch_renames.py

==============================================================================
Revision: cad864ed29
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 16:09:53 2009
Log: util: make aresamefiles take one file and just be issamefile instead.
http://code.google.com/p/hgsubversion/source/detail?r=cad864ed29

Modified:
  /hgsubversion/editor.py
  /hgsubversion/stupid.py
  /hgsubversion/util.py

==============================================================================
Revision: 990e07054f
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 15:37:19 2009
Log: replay: fix potential over-reporting of edited files in hg changelog
http://code.google.com/p/hgsubversion/source/detail?r=990e07054f

Modified:
  /hgsubversion/editor.py
  /hgsubversion/replay.py

==============================================================================
Revision: 1fd3cfa47c
Author: Augie Fackler <durin42@...>
Date: Fri Oct 16 20:33:41 2009
Log: Support for single-directory clones.
http://code.google.com/p/hgsubversion/source/detail?r=1fd3cfa47c

Added:
  /tests/test_single_dir_clone.py
Modified:
  /hgsubversion/__init__.py
  /hgsubversion/editor.py
  /hgsubversion/replay.py
  /hgsubversion/stupid.py
  /hgsubversion/svncommands.py
  /hgsubversion/svnmeta.py
  /hgsubversion/svnwrap/svn_swig_wrapper.py
  /hgsubversion/wrappers.py
  /tests/comprehensive/test_stupid_pull.py
  /tests/comprehensive/test_verify.py
  /tests/test_rebuildmeta.py
  /tests/test_util.py

Augie Fackler | 17 Oct 2009 05:57
Picon
Gravatar

Re: 6 new revisions pushed by durin42 on 2009-10-17 03:49 GMT


On Oct 16, 2009, at 10:50 PM, hgsubversion@... wrote:

> Revision: 1fd3cfa47c
> Author: Augie Fackler <durin42@...>
> Date: Fri Oct 16 20:33:41 2009
> Log: Support for single-directory clones.
> http://code.google.com/p/hgsubversion/source/detail?r=1fd3cfa47c

This has one large known issue: svn:externals support is disabled  
because I found bugs in it as I was going along. I've filed an issue  
in the BTS for it:
http://bitbucket.org/durin42/hgsubversion/issue/121

Single-directory support defaults to autodetecting wether it should be  
used, so if you try:
hg clone http://python-nose.googlecode.com/svn/trunk nose-trunk-only
it'll do what you'd expect.

Daniel Tang | 20 Oct 2009 20:39
Picon
Favicon

[PATCH] fix push for single directory repository layouts


# HG changeset patch
# User Daniel Tang <dytang@...>
# Date 1256063640 14400
# Node ID 6efa3951a1a2d4a8102b347c07d4448490ab88ba
# Parent  1fd3cfa47c5e21b0e9a1211ee6c677abad459a33
fix push for single directory repository layouts

diff --git a/hgsubversion/pushmod.py b/hgsubversion/pushmod.py
--- a/hgsubversion/pushmod.py
+++ b/hgsubversion/pushmod.py
 <at>  <at>  -100,7 +100,9  <at>  <at> 
     parent_branch = rev_ctx.parents()[0].branch()
     branch_path = 'trunk'

-    if parent_branch and parent_branch != 'default':
+    if meta.layout == 'single':
+        branch_path = ''
+    elif parent_branch and parent_branch != 'default':
         branch_path = 'branches/%s' % parent_branch

     extchanges = list(svnexternals.diff(_externals(parent),
diff --git a/tests/test_single_dir_clone.py b/tests/test_single_dir_clone.py
--- a/tests/test_single_dir_clone.py
+++ b/tests/test_single_dir_clone.py
 <at>  <at>  -1,5 +1,11  <at>  <at> 
 import shutil

+from mercurial import commands
+from mercurial import context
+from mercurial import hg
+from mercurial import node
+from mercurial import ui
+
 import test_util

 
 <at>  <at>  -70,3 +76,78  <at>  <at> 
         expect = '' # Not honestly sure what this should be...
         test = 4
         self.assertEqual(self.repo[test]['.hgsvnexternals'].data(), expect)
+
+    def test_push_single_dir(self):
+        # Tests simple pushing from default branch to a single dir repo
+        repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
+                                            stupid=False,
+                                            layout='single',
+                                            subdir='')
+        def file_callback(repo, memctx, path):
+            if path == 'adding_file':
+                return context.memfilectx(path=path,
+                                          data='foo',
+                                          islink=False,
+                                          isexec=False,
+                                          copied=False)
+            raise IOError()
+        ctx = context.memctx(repo,
+                             (repo['tip'].node(), node.nullid),
+                             'automated test',
+                             ['adding_file'],
+                             file_callback,
+                             'an_author',
+                             '2009-10-19 18:49:30 -0500',
+                             {'branch': 'default',})
+        repo.commitctx(ctx)
+        hg.update(repo, repo['tip'].node())
+        self.pushrevisions()
+        self.assertTrue('adding_file' in self.svnls(''))
+
+    def test_push_single_dir_branch(self):
+        # Tests local branches pushing to a single dir repo. Creates a fork at
+        # tip. The default branch adds a file called default, while branch foo
+        # adds a file called foo, then tries to push the foo branch and default
+        # branch in that order.
+        repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
+                                            stupid=False,
+                                            layout='single',
+                                            subdir='')
+        def file_callback(data):
+            def cb(repo, memctx, path):
+                if path == data:
+                    return context.memfilectx(path=path,
+                                              data=data,
+                                              islink=False,
+                                              isexec=False,
+                                              copied=False)
+                raise IOError()
+            return cb
+
+        def commit_to_branch(name, parent):
+            repo.commitctx(context.memctx(repo,
+                                          (parent, node.nullid),
+                                          'automated test (%s)' % name,
+                                          [name],
+                                          file_callback(name),
+                                          'an_author',
+                                          '2009-10-19 18:49:30 -0500',
+                                          {'branch': name,}))
+
+        parent = repo['tip'].node()
+        commit_to_branch('default', parent)
+        commit_to_branch('foo', parent)
+        hg.update(repo, repo['foo'].node())
+        self.pushrevisions()
+        repo = self.repo # repo is outdated after the rebase happens, refresh
+        self.assertTrue('foo' in self.svnls(''))
+        self.assertEqual(repo.branchtags().keys(), ['default'])
+        # Have to cross to another branch head, so hg.update doesn't work
+        commands.update(ui.ui(),
+                        self.repo,
+                        self.repo.branchheads('default')[1],
+                        clean=True)
+        self.pushrevisions()
+        self.assertTrue('default' in self.svnls(''))
+        self.assertEquals(len(self.repo.branchheads('default')), 1)
+

Steve Streeting | 26 Oct 2009 19:12
Picon

[PATCH] support creating historically correct merge points


Hi folks,

I've been converting my fairly large, multi-branch repository with
hgsubversion and it's worked great. The one thing that was missing for
me was the ability to record merges, because I have several branches
which have been merged at several points, and having the correct
history is very useful.

The 'gold standard' solution would be to parse the svn:merge and
svnmerge properties looking for merge commits and to generate this
dynamically, however I'm a little too short of time to tackle that.
Instead I've implemented an equivalent of the --splicemap option in
the regular 'hg convert' - a feature that I hasten to add I could
never get to work. My version is called --mergemap instead and is
considerably easier to use, all you need to do is supply a text file
with 2 branch <at> revision entries - the first is the revision at which
the merge took place, and the second is the 'second parent' from which
the merge is happening. The first parent does not need to be supplied,
unlike in --splicemap, since that's available anyway.

I've tried to stick to your conventions, I hope it's useful. I've just
run my repository through it (9200+ revisions, 31 branches) with a
representative 14 merge points, sometimes multiple times between the
same branches, and it all seems to work great.

# HG changeset patch
# User Steve Streeting <steve@...>
# Date 1256561021 0
# Node ID 94b2e5bad7c4c8976a92e1c0aaf9a1c48a00db8f
# Parent  1fd3cfa47c5e21b0e9a1211ee6c677abad459a33
Added support for 'mergemap' file. This allows you to specify merge
points in your SVN repository and have those reflected in your
converted Mercurial repository.

diff -r 1fd3cfa47c5e -r 94b2e5bad7c4 hgsubversion/__init__.py
--- a/hgsubversion/__init__.py	Fri Oct 16 23:33:41 2009 -0400
+++ b/hgsubversion/__init__.py	Mon Oct 26 12:43:41 2009 +0000
 <at>  <at>  -64,6 +64,8  <at>  <at> 
          'list of paths to search for tags in Subversion
repositories'),
         ('A', 'authors', '',
          'file mapping Subversion usernames to Mercurial authors'),
+        ('M', 'mergemap', '',
+         'file mapping Subversion merge points to Mercurial merges'),
         ('', 'filemap', '',
          'file containing rules for remapping Subversion repository
paths'),
         ('', 'layout', 'auto', ('import standard layout or single '
 <at>  <at>  -163,6 +165,7  <at>  <at> 
          [('u', 'svn-url', '', 'path to the Subversion server.'),
           ('', 'stupid', False, 'be stupid and use diffy replay.'),
           ('A', 'authors', '', 'username mapping filename'),
+          ('M', 'mergemap', '', 'merge mapping filename'),
           ('', 'filemap', '',
            'remap file to exclude paths or include only certain
paths'),
           ('', 'force', False, 'force an operation to happen'),
diff -r 1fd3cfa47c5e -r 94b2e5bad7c4 hgsubversion/maps.py
--- a/hgsubversion/maps.py	Fri Oct 16 23:33:41 2009 -0400
+++ b/hgsubversion/maps.py	Mon Oct 26 12:43:41 2009 +0000
 <at>  <at>  -284,3 +284,85  <at>  <at> 
                 msg = 'ignoring bad line in filemap %s: %s\n'
                 self.ui.warn(msg % (fn, line.rstrip()))
         f.close()
+
+class MergeMap(dict):
+    '''A mapping from Subversion revision number to _second_ parent
+    that indicates a merge has taken place here.
+    This allows merge points to be imported.
+
+	The format of the mergemap file is one merge per line, with the
+	first parameter identifying the revision number and branch of the
merge
+	target, and the second parameter identifying the revision number and
branch
+	of the source of the merge, which will become the 'second parent'.
+	For example:
+
+	trunk <at> 9203 release_1.0 <at> 9200
+
+	This means that revision 9203 in trunk will have a second parent
added
+	which is revision 9200 from the release_1.0 branch.
+
+	At some point it would be good to pick this information up
automatically
+	from the svnmerge and svn:merge properties in svn.
+    '''
+
+    def __init__(self, ui, path):
+        '''Initialise a new MergeMap.
+
+        The ui argument is used to print diagnostic messages.
+
+        The path argument is the location of the backing store,
+        typically .hg/mergemap.
+        '''
+        self.ui = ui
+        self.path = path
+        self.super = super(MergeMap, self)
+        self.super.__init__()
+        self.load(path)
+
+    def load(self, path):
+        ''' Load mappings from a file at the specified path. '''
+        if not os.path.exists(path):
+            return
+
+        writing = False
+        if path != self.path:
+            writing = open(self.path, 'a')
+
+        self.ui.note('reading mergemap from %s\n' % path)
+        f = open(path, 'r')
+        for number, line in enumerate(f):
+
+            if writing:
+                writing.write(line)
+
+            line = line.split('#')[0]
+            if not line.strip():
+                continue
+
+            try:
+                src, dst = line.split(' ', 1)
+            except (IndexError, ValueError):
+                msg = 'ignoring line %i in merge map %s: %s\n'
+                self.ui.warn(msg % (number, path, line.rstrip()))
+                continue
+
+            src = src.strip()
+            dst = dst.strip()
+            srcbranch, srcrev = src.split(' <at> ', 1)
+            dstbranch, dstrev = dst.split(' <at> ', 1)
+            srcrev = int(srcrev.strip())
+            srcbranch = srcbranch.strip()
+            dstrev = int(dstrev.strip())
+            dstbranch = dstbranch.strip()
+
+            self.ui.debug('adding merge %s <at> %s %s <at> %s to merge map\n' %
(srcbranch, srcrev, dstbranch, dstrev))
+            if (srcrev,srcbranch) in self and (dstrev,dstbranch) !=
self[srcrev, srcbranch]:
+                msg = 'overriding merge: "%s" to "%s" (%s)\n'
+                self.ui.warn(msg % (self[srcrev, srcbranch], dst,
src))
+            self[srcrev, srcbranch] = dstrev, dstbranch
+
+        f.close()
+        if writing:
+            writing.flush()
+            writing.close()
+
diff -r 1fd3cfa47c5e -r 94b2e5bad7c4 hgsubversion/replay.py
--- a/hgsubversion/replay.py	Fri Oct 16 23:33:41 2009 -0400
+++ b/hgsubversion/replay.py	Mon Oct 26 12:43:41 2009 +0000
 <at>  <at>  -123,7 +123,8  <at>  <at> 
             del current.emptybranches[branch]

         files = dict(files)
-        parents = meta.get_parent_revision(rev.revnum, branch),
revlog.nullid
+        secondparent = meta.getsecondparentctx(rev.revnum, branch)
+        parents = meta.get_parent_revision(rev.revnum, branch),
secondparent
         if parents[0] in closedrevs and branch in meta.closebranches:
             continue

diff -r 1fd3cfa47c5e -r 94b2e5bad7c4 hgsubversion/svnmeta.py
--- a/hgsubversion/svnmeta.py	Fri Oct 16 23:33:41 2009 -0400
+++ b/hgsubversion/svnmeta.py	Mon Oct 26 12:43:41 2009 +0000
 <at>  <at>  -49,6 +49,7  <at>  <at> 

         author_host = self.ui.config('hgsubversion', 'defaulthost',
uuid)
         authors = self.ui.config('hgsubversion', 'authormap')
+        merges = self.ui.config('hgsubversion', 'mergemap')
         tag_locations = self.ui.configlist('hgsubversion',
'tagpaths', ['tags'])
         self.usebranchnames = self.ui.configbool('hgsubversion',
                                                   'usebranchnames',
True)
 <at>  <at>  -86,6 +87,9  <at>  <at> 
                                  defaulthost=author_host)
         if authors: self.authors.load(authors)

+        self.merges = maps.MergeMap(self.ui, self.merges_file)
+        if merges: self.merges.load(merges)
+
         self.lastdate = '1970-01-01 00:00:00 -0000'
         self.filemap = maps.FileMap(repo)

 <at>  <at>  -150,6 +154,10  <at>  <at> 
         return os.path.join(self.meta_data_dir, 'authors')

      <at> property
+    def merges_file(self):
+        return os.path.join(self.meta_data_dir, 'merges')
+
+     <at> property
     def layoutfile(self):
         return os.path.join(self.meta_data_dir, 'layout')

 <at>  <at>  -593,3 +601,11  <at>  <at> 
                              extra)
         new = self.repo.commitctx(ctx)
         self.ui.status('Marked branch %s as closed.\n' % (branch or
'default'))
+
+    def getsecondparentctx(self, rev, branch):
+        if (rev,branch) in self.merges:
+            return self.revmap[ self.merges[rev, branch] ]
+        # None branch is trunk
+        elif (rev,"trunk") in self.merges:
+            return self.revmap[ self.merges[rev, 'trunk'] ]
+        return revlog.nullid
diff -r 1fd3cfa47c5e -r 94b2e5bad7c4 hgsubversion/wrappers.py
--- a/hgsubversion/wrappers.py	Fri Oct 16 23:33:41 2009 -0400
+++ b/hgsubversion/wrappers.py	Mon Oct 26 12:43:41 2009 +0000
 <at>  <at>  -356,6 +356,7  <at>  <at> 
 optionmap = {
     'tagpaths': ('hgsubversion', 'tagpaths'),
     'authors': ('hgsubversion', 'authormap'),
+    'mergemap': ('hgsubversion', 'mergemap'),
     'filemap': ('hgsubversion', 'filemap'),
     'stupid': ('hgsubversion', 'stupid'),
     'defaulthost': ('hgsubversion', 'defaulthost'),
 <at>  <at>  -364,7 +365,7  <at>  <at> 
     'layout': ('hgsubversion', 'layout'),
 }

-dontretain = { 'hgsubversion': set(['authormap', 'filemap',
'layout', ]) }
+dontretain = { 'hgsubversion': set(['authormap', 'mergemap',
'filemap', 'layout', ]) }

 def clone(orig, ui, source, dest=None, **opts):
     """


Gmane