FreeBSD Bugzilla – Attachment 144050 Details for
Bug 191294
[PATCH] devel/mercurial --authormapsuffix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Proposed port patch provided by gjb
devel-mercurial.diff.txt (text/plain), 6.68 KB, created by
Lawrence Stewart
on 2014-06-23 01:11:30 UTC
(
hide
)
Description:
Proposed port patch provided by gjb
Filename:
MIME Type:
Creator:
Lawrence Stewart
Created:
2014-06-23 01:11:30 UTC
Size:
6.68 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 358572) >+++ Makefile (working copy) >@@ -14,10 +14,11 @@ > USE_PYTHON= 2 > USE_PYDISTUTILS=yes > >-OPTIONS_DEFINE= CA_BUNDLE DATA DOCS EXAMPLES NLS >+OPTIONS_DEFINE= CA_BUNDLE DATA DOCS EXAMPLES NLS FREEBSD > OPTIONS_DEFAULT=DATA > OPTIONS_SUB= yes > CA_BUNDLE_DESC= Install CA Certificates >+FREEBSD_DESC= Patches used internally by the FreeBSD Project > > CONTRIB_FILES= bash_completion \ > casesmash.py \ >@@ -66,6 +67,10 @@ > EXTRA_PATCHES+= ${FILESDIR}/extra-patch-setup.py > .endif > >+.if ${PORT_OPTIONS:MFREEBSD} >+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-authormapsuffix >+.endif >+ > post-install: > ${INSTALL_MAN} ${WRKSRC}/doc/*.1 ${STAGEDIR}${PREFIX}/man/man1/ > ${INSTALL_MAN} ${WRKSRC}/doc/*.5 ${STAGEDIR}${PREFIX}/man/man5/ >Index: files/extra-patch-authormapsuffix >=================================================================== >--- files/extra-patch-authormapsuffix (revision 0) >+++ files/extra-patch-authormapsuffix (working copy) >@@ -0,0 +1,166 @@ >+--- hgext/convert/__init__.py.orig 2014-06-01 17:15:14.000000000 -0400 >++++ hgext/convert/__init__.py 2014-06-22 16:11:35.609199105 -0400 >+@@ -85,6 +85,9 @@ >+ >+ Empty lines and lines starting with a ``#`` are ignored. >+ >++ The authormapsuffix can be used to append set text to each >++ post-authormap-translated author name. >++ >+ The filemap is a file that allows filtering and remapping of files >+ and directories. Each line can contain one of the following >+ directives:: >+@@ -314,6 +317,8 @@ >+ _('import up to source revision REV'), _('REV')), >+ ('A', 'authormap', '', >+ _('remap usernames using this file'), _('FILE')), >++ ('', 'authormapsuffix', '', >++ _('append this suffix to remapped author names'), _('SUFFIX')), >+ ('', 'filemap', '', >+ _('remap file names using contents of file'), _('FILE')), >+ ('', 'splicemap', '', >+--- hgext/convert/convcmd.py.orig 2014-06-01 17:15:14.000000000 -0400 >++++ hgext/convert/convcmd.py 2014-06-22 16:11:35.610199033 -0400 >+@@ -103,12 +103,15 @@ >+ self.commitcache = {} >+ self.authors = {} >+ self.authorfile = None >++ self.authormapsuffix = '' >+ >+ # Record converted revisions persistently: maps source revision >+ # ID to target revision ID (both strings). (This is how >+ # incremental conversions work.) >+ self.map = mapfile(ui, revmapfile) >+ >++ if opts.get('authormapsuffix'): >++ self.authormapsuffix = opts.get('authormapsuffix') >+ # Read first the dst author map if any >+ authorfile = self.dest.authorfile() >+ if authorfile and os.path.exists(authorfile): >+@@ -356,7 +359,7 @@ >+ continue >+ >+ srcauthor = srcauthor.strip() >+- dstauthor = dstauthor.strip() >++ dstauthor = dstauthor.strip() + self.authormapsuffix >+ if self.authors.get(srcauthor) in (None, dstauthor): >+ msg = _('mapping author %s to %s\n') >+ self.ui.debug(msg % (srcauthor, dstauthor)) >+@@ -370,7 +373,8 @@ >+ >+ def cachecommit(self, rev): >+ commit = self.source.getcommit(rev) >+- commit.author = self.authors.get(commit.author, commit.author) >++ commit.author = self.authors.get(commit.author, >++ commit.author + self.authormapsuffix) >+ # If commit.branch is None, this commit is coming from the source >+ # repository's default branch and destined for the default branch in the >+ # destination repository. For such commits, passing a literal "None" >+--- tests/test-convert-authormap.t.orig 2014-06-01 17:15:14.000000000 -0400 >++++ tests/test-convert-authormap.t 2014-06-22 16:11:35.610199033 -0400 >+@@ -10,6 +10,8 @@ >+ $ cd orig >+ $ echo foo > foo >+ $ HGUSER='user name' hg ci -qAm 'foo' >++ $ echo bar > bar >++ $ HGUSER='user name 2' hg ci -qAm 'bar' >+ $ cd .. >+ >+ Explicit --authors >+@@ -26,13 +28,19 @@ >+ scanning source... >+ sorting... >+ converting... >+- 0 foo >++ 1 foo >++ 0 bar >+ writing author map file $TESTTMP/new/.hg/authormap (glob) >+ $ cat new/.hg/authormap >+ user name=Long User Name >+ $ hg -Rnew log >+- changeset: 0:d89716e88087 >++ changeset: 1:263e7765e4b7 >+ tag: tip >++ user: user name 2 >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: bar >++ >++ changeset: 0:d89716e88087 >+ user: Long User Name >+ date: Thu Jan 01 00:00:00 1970 +0000 >+ summary: foo >+@@ -48,11 +56,72 @@ >+ scanning source... >+ sorting... >+ converting... >+- 0 foo >++ 1 foo >++ 0 bar >+ $ hg -Rnew log >+- changeset: 0:d89716e88087 >++ changeset: 1:263e7765e4b7 >+ tag: tip >++ user: user name 2 >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: bar >++ >++ changeset: 0:d89716e88087 >+ user: Long User Name >+ date: Thu Jan 01 00:00:00 1970 +0000 >+ summary: foo >+ >++ $ rm -rf new >++ >++Use authormapsuffix together with authormap >++ >++ $ cat > authormap.txt <<EOF >++ > user name = username >++ > user name 2 = username2 >++ > EOF >++ $ hg convert --authormap authormap.txt --authormapsuffix '@test.org' orig new >++ initializing destination new repository >++ scanning source... >++ sorting... >++ converting... >++ 1 foo >++ 0 bar >++ writing author map file $TESTTMP/new/.hg/authormap >++ $ cat new/.hg/authormap >++ user name 2=username2@test.org >++ user name=username@test.org >++ $ hg -Rnew log >++ changeset: 1:aeeaab422b32 >++ tag: tip >++ user: username2@test.org >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: bar >++ >++ changeset: 0:51317d63da9e >++ user: username@test.org >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: foo >++ >++ $ rm -rf new >++ >++Use authormapsuffix stand alone >++ >++ $ hg convert --authormapsuffix '@test.org' orig new >++ initializing destination new repository >++ scanning source... >++ sorting... >++ converting... >++ 1 foo >++ 0 bar >++ $ hg -Rnew log >++ changeset: 1:94e0dcfe3b0d >++ tag: tip >++ user: user name 2@test.org >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: bar >++ >++ changeset: 0:e2ff155c86b8 >++ user: user name@test.org >++ date: Thu Jan 01 00:00:00 1970 +0000 >++ summary: foo >++ >++ > >Property changes on: files/extra-patch-authormapsuffix >___________________________________________________________________ >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 191294
: 144050