Rev 985: Move utility function to separate file. in file:///data/jelmer/bzr-svn/layout/
Jelmer Vernooij
jelmer at samba.org
Fri May 2 18:05:07 BST 2008
At file:///data/jelmer/bzr-svn/layout/
------------------------------------------------------------
revno: 985
revision-id: jelmer at samba.org-20080502170505-30k337eigc6sy17y
parent: jelmer at samba.org-20080502161547-dcoxx133dwnkamwe
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: layout
timestamp: Fri 2008-05-02 19:05:05 +0200
message:
Move utility function to separate file.
added:
util.py util.py-20080502170127-o220e9py99vt69s6-1
modified:
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
=== modified file 'commit.py'
--- a/commit.py 2008-04-12 16:13:47 +0000
+++ b/commit.py 2008-05-02 17:05:05 +0000
@@ -28,6 +28,8 @@
from bzrlib.revision import NULL_REVISION
from bzrlib.trace import mutter, warning
+from bzrlib.plugins.svn import util
+
from cStringIO import StringIO
from errors import ChangesRootLHSHistory, MissingPrefix, RevpropChangeFailed
from svk import (generate_svk_feature, serialize_svk_features,
@@ -35,7 +37,6 @@
from logwalker import lazy_dict
from mapping import parse_revision_id
from repository import SvnRepositoryFormat, SvnRepository
-from scheme import is_valid_property_name
import urllib
@@ -452,7 +453,7 @@
bp_parts, -1)
self.revision_metadata = None
for prop in self._svn_revprops:
- if not is_valid_property_name(prop):
+ if not util.is_valid_property_name(prop):
warning("Setting property %r with invalid characters in name" % prop)
try:
self.editor = self.repository.transport.get_commit_editor(
@@ -491,7 +492,7 @@
# Set all the revprops
for prop, value in self._svnprops.items():
- if not is_valid_property_name(prop):
+ if not util.is_valid_property_name(prop):
warning("Setting property %r with invalid characters in name" % prop)
if value is not None:
value = value.encode('utf-8')
=== added file 'util.py'
--- a/util.py 1970-01-01 00:00:00 +0000
+++ b/util.py 2008-05-02 17:05:05 +0000
@@ -0,0 +1,22 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+def is_valid_property_name(prop):
+ if not prop[0].isalnum() and not prop[0] in ":_":
+ return False
+ for c in prop[1:]:
+ if not c.isalnum() and not c in "-:._":
+ return False
+ return True
More information about the bazaar-commits
mailing list