diff options
author | koobs <koobs@FreeBSD.org> | 2014-06-27 20:07:41 +0800 |
---|---|---|
committer | koobs <koobs@FreeBSD.org> | 2014-06-27 20:07:41 +0800 |
commit | b14c1d4b142a165c0a7955b6e2049eff9759bee6 (patch) | |
tree | c9b74d1ef314e4b9b46c837e636f5d0b37177080 /devel | |
parent | 281f251a3e4d875376dac6f8f18ad8116337d441 (diff) | |
download | freebsd-ports-gnome-b14c1d4b142a165c0a7955b6e2049eff9759bee6.tar.gz freebsd-ports-gnome-b14c1d4b142a165c0a7955b6e2049eff9759bee6.tar.zst freebsd-ports-gnome-b14c1d4b142a165c0a7955b6e2049eff9759bee6.zip |
devel/mercurial: Add FREEBSD option for authormapsuffix patch
Add a patch by lstewart that allows appending a suffix to author names
during svn -> hg incremental conversions.
Functionality is provided by the "--authormapsuffix" option, and can be used in
conjunction with "--authormap".
This has been submitted upstream [1][2], but will not be merged into the
official distribution, at least in the short term.
[1] http://bz.selenic.com/show_bug.cgi?id=4171
[2] http://www.selenic.com/pipermail/mercurial-devel/2014-February/056310.html
PR: 191294
Submitted by: gjb, lstewart
Diffstat (limited to 'devel')
-rw-r--r-- | devel/mercurial/Makefile | 8 | ||||
-rw-r--r-- | devel/mercurial/files/extra-patch-authormapsuffix | 166 |
2 files changed, 173 insertions, 1 deletions
diff --git a/devel/mercurial/Makefile b/devel/mercurial/Makefile index f3a1084ce246..e45b0520f44c 100644 --- a/devel/mercurial/Makefile +++ b/devel/mercurial/Makefile @@ -3,6 +3,7 @@ PORTNAME= mercurial PORTVERSION= 3.0.1 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= http://mercurial.selenic.com/release/ @@ -14,10 +15,11 @@ LICENSE= GPLv2 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 +68,10 @@ SUB_FILES= pkg-message 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/ diff --git a/devel/mercurial/files/extra-patch-authormapsuffix b/devel/mercurial/files/extra-patch-authormapsuffix new file mode 100644 index 000000000000..7d2a5cbb25aa --- /dev/null +++ b/devel/mercurial/files/extra-patch-authormapsuffix @@ -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 ++ ++ |