Unknown | 24 May 2013 02:24

[PATCH] commit: fix exception handling on transaction close

# HG changeset patch
# User Matt Mackall <mpm@...>
# Date 1369354982 18000
#      Thu May 23 19:23:02 2013 -0500
# Node ID cc774e975aed52e7b34838e1f734f335d5591cc9
# Parent  f0ebc71134292e2f8fe7bfb124d0ad8a487e6d0b
commit: fix exception handling on transaction close

On SVN 1.6 at least, a failing pre-commit hook appears to abort a
commit transaction without us needing to do it manually. This is
apparently managed by a callback at the end of SVN's internal commit
callback chain.

Subsequently trying to abort an already-aborted transaction results in
a spurious "Transaction cleanup failed" message that breaks tests.

To fix this, we simply move the commit call out of try/except block.

diff -r f0ebc7113429 -r cc774e975aed hgsubversion/svnwrap/subvertpy_wrapper.py
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py	Fri May 10 18:52:28 2013 -0500
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py	Thu May 23 19:23:02 2013 -0500
 <at>  <at>  -458,10 +458,10  <at>  <at> 
             rooteditor = commiteditor.open_root()
             visitdir(rooteditor, '', paths, 0)
             rooteditor.close()
-            commiteditor.close()
         except:
             commiteditor.abort()
             raise
+        commiteditor.close()
(Continue reading)

Matt Mackall | 24 May 2013 02:25
Favicon

[PATCH RFC] commit: fix exception handling on transaction close

# HG changeset patch
# User Matt Mackall <mpm@...>
# Date 1369354982 18000
#      Thu May 23 19:23:02 2013 -0500
# Node ID cc774e975aed52e7b34838e1f734f335d5591cc9
# Parent  f0ebc71134292e2f8fe7bfb124d0ad8a487e6d0b
commit: fix exception handling on transaction close

On SVN 1.6 at least, a failing pre-commit hook appears to abort a
commit transaction without us needing to do it manually. This is
apparently managed by a callback at the end of SVN's internal commit
callback chain.

Subsequently trying to abort an already-aborted transaction results in
a spurious "Transaction cleanup failed" message that breaks tests.

To fix this, we simply move the commit call out of try/except block.

diff -r f0ebc7113429 -r cc774e975aed hgsubversion/svnwrap/subvertpy_wrapper.py
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py	Fri May 10 18:52:28 2013 -0500
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py	Thu May 23 19:23:02 2013 -0500
 <at>  <at>  -458,10 +458,10  <at>  <at> 
             rooteditor = commiteditor.open_root()
             visitdir(rooteditor, '', paths, 0)
             rooteditor.close()
-            commiteditor.close()
         except:
             commiteditor.abort()
             raise
+        commiteditor.close()
(Continue reading)

David Schleimer | 20 May 2013 23:51

[PATCH 1 of 6 v2] layouts: refactor out svn path to mercurial branch logic

# HG changeset patch
# User David Schleimer <dschleimer@...>
# Date 1366841231 25200
#      Wed Apr 24 15:07:11 2013 -0700
# Node ID 2212fe80d5be975907ee82aa9dde96e7b6bc2897
# Parent  f0ebc71134292e2f8fe7bfb124d0ad8a487e6d0b
layouts: refactor out svn path to mercurial branch logic

This pulls the logic for mapping from svn path to mercurial branch
name out of svnmeta.py and into the new layouts library.  It also sets
up the structure for that library.  This diff does not modify any call
to svnmeta.localname, rather leaving it in place as a simple proxy to
the new layout object.

diff --git a/hgsubversion/layouts/__init__.py b/hgsubversion/layouts/__init__.py
--- a/hgsubversion/layouts/__init__.py
+++ b/hgsubversion/layouts/__init__.py
 <at>  <at>  -9,10 +9,36  <at>  <at> 

 """

+from mercurial import util as hgutil
+
 import detect
 import persist
+import single
+import standard

 __all__ = [
     "detect",
(Continue reading)

hgsubversion | 18 May 2013 16:34

push by durin42 - revsets: fix nativerevs fallback on 2013-05-18 14:34 GMT

Revision: f0ebc7113429
Branch:   default
Author:   Matt Mackall <mpm@...>
Date:     Fri May 10 16:52:28 2013
Log:      revsets: fix nativerevs fallback
http://code.google.com/p/hgsubversion/source/detail?r=f0ebc7113429

Modified:
  /hgsubversion/util.py

--

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

David Schleimer | 17 May 2013 20:48

[PATCH 1 of 6 RESEND] layouts: refactor out svn path to mercurial branch logic

# HG changeset patch
# User David Schleimer <dschleimer@...>
# Date 1366841231 25200
#      Wed Apr 24 15:07:11 2013 -0700
# Node ID 14efa60ac7e639f885a00a80bc51e6fba8dc3a07
# Parent  f0bde4bf1f7819b15c93be059b8d01f21cd8a146
layouts: refactor out svn path to mercurial branch logic

This pulls the logic for mapping from svn path to mercurial branch
name out of svnmeta.py and into the new layouts library.  It also sets
up the structure for that library.  This diff does not modify any call
to svnmeta.localname, rather leaving it in place as a simple proxy to
the new layout object.

diff --git a/hgsubversion/layouts/__init__.py b/hgsubversion/layouts/__init__.py
--- a/hgsubversion/layouts/__init__.py
+++ b/hgsubversion/layouts/__init__.py
 <at>  <at>  -9,10 +9,36  <at>  <at> 

 """

+from mercurial import util as hgutil
+
 import detect
 import persist
+import single
+import standard

 __all__ = [
     "detect",
(Continue reading)

Matt Mackall | 14 May 2013 20:13
Favicon

[PATCH] revsets: fix nativerevs fallback

# HG changeset patch
# User Matt Mackall <mpm@...>
# Date 1368229948 18000
#      Fri May 10 18:52:28 2013 -0500
# Node ID f0ebc71134292e2f8fe7bfb124d0ad8a487e6d0b
# Parent  f0bde4bf1f7819b15c93be059b8d01f21cd8a146
revsets: fix nativerevs fallback

diff -r f0bde4bf1f78 -r f0ebc7113429 hgsubversion/util.py
--- a/hgsubversion/util.py	Tue Apr 23 13:59:38 2013 -0500
+++ b/hgsubversion/util.py	Fri May 10 18:52:28 2013 -0500
 <at>  <at>  -343,7 +343,7  <at>  <at> 
 def revset_stringset(orig, repo, subset, x):
     if x.startswith('r') and x[1:].isdigit():
         return revset_svnrev(repo, subset, ('string', x[1:]))
-    return orig
+    return orig(repo, subset, x)

 def getfilestoresize(ui):
     """Return the replay or stupid file memory store size in megabytes or -1"""

--

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

Picon
Gravatar

[PATCH] updatemeta/rebuildmeta: handle hidden changesets

# HG changeset patch
# User Dan Villiom Podlaski Christiansen <dan@...>
# Date 1368438589 -7200
#      Mon May 13 11:49:49 2013 +0200
# Node ID 8d77c15a0090e5d4c73c9845b34d734d5cfa186d
# Parent  f0bde4bf1f7819b15c93be059b8d01f21cd8a146
updatemeta/rebuildmeta: handle hidden changesets

diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
 <at>  <at>  -135,7 +135,12  <at>  <at>  def _buildmeta(ui, repo, args, partial=F
     # changesets that close a branch, and store their first parent
     for rev in xrange(startrev, len(repo)):
         util.progress(ui, 'prepare', rev - startrev, total=numrevs)
-        ctx = repo[rev]
+        try:
+            ctx = repo[rev]
+        except error.RepoError:
+            # this revision is hidden
+            continue
+
         convinfo = util.getsvnrev(ctx, None)
         if not convinfo:
             continue
 <at>  <at>  -163,7 +168,12  <at>  <at>  def _buildmeta(ui, repo, args, partial=F

     for rev in xrange(startrev, len(repo)):
         util.progress(ui, 'rebuild', rev-startrev, total=numrevs)
-        ctx = repo[rev]
(Continue reading)

maugustin | 2 May 2013 10:03

svn author lookup case insensitive?

Hi developer,

would it make sense to do the author lookup during SVN pull run case insensitive?

We migrated some maschines from Windows XP to Windows 7 and now the username from Windows is not lowercase but uppercase. I've put up now every entry in authormap file twice (additional with all letters uppercase) and my second change was to patch the hgsubversion code to do the job.

Would you like to accept this patch or have any comment on it?

Kind regards
Michael

--
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/hgsubversion?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
hgsubversion | 30 Apr 2013 19:15

push by durin42 - revsets: add support for 'r123' revision labels... on 2013-04-30 17:15 GMT

Revision: f0bde4bf1f78
Branch:   default
Author:   Matt Mackall <mpm@...>
Date:     Tue Apr 23 11:59:38 2013
Log:      revsets: add support for 'r123' revision labels

This is controlled by an hgsubversion.nativerevs boolean (off by default).
http://code.google.com/p/hgsubversion/source/detail?r=f0bde4bf1f78

Modified:
  /hgsubversion/__init__.py
  /hgsubversion/util.py

--

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

David Schleimer | 30 Apr 2013 01:10

[PATCH 1 of 6] layouts: refactor out svn path to mercurial branch logic

# HG changeset patch
# User David Schleimer <dschleimer@...>
# Date 1366841231 25200
#      Wed Apr 24 15:07:11 2013 -0700
# Node ID 8552fbda8e3b552a901fe22425597ff199a77b4f
# Parent  bdc9b21ea8d079ace9832f9e7240a670a2eba52d
layouts: refactor out svn path to mercurial branch logic

This pulls the logic for mapping from svn path to mercurial branch
name out of svnmeta.py and into the new layouts library.  It also sets
up the structure for that library.  This diff does not modify any call
to svnmeta.localname, rather leaving it in place as a simple proxy to
the new layout object.

diff --git a/hgsubversion/layouts/__init__.py b/hgsubversion/layouts/__init__.py
--- a/hgsubversion/layouts/__init__.py
+++ b/hgsubversion/layouts/__init__.py
 <at>  <at>  -9,10 +9,36  <at>  <at> 

 """

+from mercurial import util as hgutil
+
 import detect
 import persist
+import single
+import standard

 __all__ = [
     "detect",
+    "layout_from_name",
     "persist",
     ]
+
+# This is the authoritative store of what layouts are available.
+# The intention is for extension authors who wish to build their own
+# layout to add it to this dict.
+NAME_TO_CLASS = {
+    "single": single.SingleLayout,
+    "standard": standard.StandardLayout,
+}
+
+
+def layout_from_name(name):
+    """Returns a layout module given the layout name
+
+    You should use one of the layout.detect.* functions to get the
+    name to pass to this function.
+
+    """
+
+    if name not in NAME_TO_CLASS:
+        raise hgutil.Abort('Unknown hgsubversion layout: %s' %name)
+    return NAME_TO_CLASS[name]()
diff --git a/hgsubversion/layouts/base.py b/hgsubversion/layouts/base.py
new file mode 100644
--- /dev/null
+++ b/hgsubversion/layouts/base.py
 <at>  <at>  -0,0 +1,20  <at>  <at> 
+"""Module to hold the base API for layout classes.
+
+This module should not contain any implementation, just a definition
+of the API concrete layouts are expected to implement.
+
+"""
+
+from mercurial import util as hgutil
+
+class BaseLayout(object):
+
+    def __unimplemented(self, method_name):
+        raise hgutil.Abort(
+            "Incomplete layout implementation: %s.%s doesn't implement %s" %
+            (self.__module__, self.__name__, method_name))
+
+    def localname(self, path):
+        """Compute the local name for a branch located at path.
+        """
+        self.__unimplemented('localname')
diff --git a/hgsubversion/layouts/single.py b/hgsubversion/layouts/single.py
new file mode 100644
--- /dev/null
+++ b/hgsubversion/layouts/single.py
 <at>  <at>  -0,0 +1,9  <at>  <at> 
+
+
+import base
+
+class SingleLayout(base.BaseLayout):
+    """A layout with only the default branch"""
+
+    def localname(self, path):
+        return 'default'
diff --git a/hgsubversion/layouts/standard.py b/hgsubversion/layouts/standard.py
new file mode 100644
--- /dev/null
+++ b/hgsubversion/layouts/standard.py
 <at>  <at>  -0,0 +1,14  <at>  <at> 
+
+
+import base
+
+
+class StandardLayout(base.BaseLayout):
+    """The standard trunk, branches, tags layout"""
+
+    def localname(self, path):
+        if path == 'trunk':
+            return None
+        elif path.startswith('branches/'):
+            return path[len('branches/'):]
+        return  '../%s' % path
diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
 <at>  <at>  -72,6 +72,7  <at>  <at> 
             self.tag_locations = tag_locations
         self._layout = layouts.detect.layout_from_file(self.meta_data_dir,
                                                        ui=self.repo.ui)
+        self._layoutobj = None
         pickle_atomic(self.tag_locations, self.tag_locations_file)
         # ensure nested paths are handled properly
         self.tag_locations.sort()
 <at>  <at>  -108,6 +109,12  <at>  <at> 
         return self._layout

      <at> property
+    def layoutobj(self):
+        if not self._layoutobj:
+            self._layoutobj = layouts.layout_from_name(self.layout)
+        return self._layoutobj
+
+     <at> property
     def editor(self):
         if not hasattr(self, '_editor'):
             self._editor = editor.HgEditor(self)
 <at>  <at>  -215,13 +222,7  <at>  <at> 
     def localname(self, path):
         """Compute the local name for a branch located at path.
         """
-        if self.layout == 'single':
-            return 'default'
-        if path == 'trunk':
-            return None
-        elif path.startswith('branches/'):
-            return path[len('branches/'):]
-        return  '../%s' % path
+        return self.layoutobj.localname(path)

     def remotename(self, branch):
         if self.layout == 'single':

--

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

Matt Mackall | 24 Apr 2013 04:32
Favicon

[PATCH] revsets: add support for 'r123' revision labels

# HG changeset patch
# User Matt Mackall <mpm@...>
# Date 1366743578 18000
#      Tue Apr 23 13:59:38 2013 -0500
# Node ID f0bde4bf1f7819b15c93be059b8d01f21cd8a146
# Parent  bdc9b21ea8d079ace9832f9e7240a670a2eba52d
revsets: add support for 'r123' revision labels

This is controlled by an hgsubversion.nativerevs boolean (off by default).

diff -r bdc9b21ea8d0 -r f0bde4bf1f78 hgsubversion/__init__.py
--- a/hgsubversion/__init__.py	Mon Apr 22 14:27:05 2013 -0700
+++ b/hgsubversion/__init__.py	Tue Apr 23 13:59:38 2013 -0500
 <at>  <at>  -180,6 +180,9  <at>  <at> 
         for tunnel in ui.configlist('hgsubversion', 'tunnels'):
             hg.schemes['svn+' + tunnel] = svnrepo

+    if revset and ui.configbool('hgsubversion', 'nativerevs'):
+        extensions.wrapfunction(revset, 'stringset', util.revset_stringset)
+
 _old_local = hg.schemes['file']
 def _lookup(url):
     if util.islocalrepo(url):
diff -r bdc9b21ea8d0 -r f0bde4bf1f78 hgsubversion/util.py
--- a/hgsubversion/util.py	Mon Apr 22 14:27:05 2013 -0700
+++ b/hgsubversion/util.py	Tue Apr 23 13:59:38 2013 -0500
 <at>  <at>  -340,6 +340,11  <at>  <at> 
     'svnrev': revset_svnrev,
 }

+def revset_stringset(orig, repo, subset, x):
+    if x.startswith('r') and x[1:].isdigit():
+        return revset_svnrev(repo, subset, ('string', x[1:]))
+    return orig
+
 def getfilestoresize(ui):
     """Return the replay or stupid file memory store size in megabytes or -1"""
     size = ui.configint('hgsubversion', 'filestoresize', 200)

--

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


Gmane