Skip to content

Instantly share code, notes, and snippets.

@Hoikas
Created December 11, 2012 17:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Hoikas/4260306 to your computer and use it in GitHub Desktop.
adamj@gehn:~/test$ ./binkbegone.sh cwe-ou Plasma
OK to delete? (y/n) y
+ rm -rf old-hg uncorrupt-git uncorrupt-hg filemap1 filemap2 filtered-hg filtered-git
+ set -x
+ set -e
+ hg init old-hg
+ hg -R old-hg pull -r e106bb4cef24 cwe-ou
+ git init --bare uncorrupt-git
+ cd old-hg
+ hg push ../uncorrupt-git
+ hg bookmark --delete master
+ cd ../uncorrupt-git
+ git branch ob1 a2f42c3fdce88da8c538570a666c07359670edd8
+ git branch ob2 5c3cab7f4f1134925283dd526233131856b7a894
+ cd ..
+ hg init uncorrupt-hg
+ cd uncorrupt-hg
+ hg pull -r ob1 ../uncorrupt-git
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions unknown of Mercurial.
** Please disable hggit and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.3rc2 (default, Apr 22 2012, 22:35:38) [GCC 4.6.3]
** Mercurial Distributed SCM (version 2.4.1)
** Extensions loaded: hggit, convert, mq
Traceback (most recent call last):
File "/usr/local/bin/hg", line 5, in <module>
pkg_resources.run_script('mercurial==2.4.1', 'hg')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/EGG-INFO/scripts/hg", line 38, in <module>
mercurial.dispatch.run()
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 28, in run
sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 65, in dispatch
return _runcatch(req)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 88, in _runcatch
return _dispatch(req)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 741, in _dispatch
cmdpats, cmdoptions)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 514, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 831, in _runcommand
return checkargs()
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 802, in checkargs
return cmdfunc()
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/dispatch.py", line 738, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/util.py", line 472, in check
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/extensions.py", line 144, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/util.py", line 472, in check
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/hgext/mq.py", line 3546, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/util.py", line 472, in check
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/commands.py", line 4659, in pull
checkout = str(repo.changelog.rev(other.lookup(checkout)))
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/changelog.py", line 181, in rev
r = super(changelog, self).rev(node)
File "/usr/local/lib/python2.7/dist-packages/mercurial-2.4.1-py2.7-linux-i686.egg/mercurial/revlog.py", line 287, in rev
return self._nodecache[node]
ValueError: 20-byte hash required
+ true
+ hg pull -r ob2 ../uncorrupt-git
+ hg pull -r master ../uncorrupt-git
+ hg gclear
+ rm .hg/git-remote-refs
+ rm .hg/git-tags
+ hg bookmark --delete ob1
+ hg bookmark --delete ob2
+ hg bookmark --delete master
+ cd ..
+ cat
+ cp filemap2 filemap1
+ echo 'exclude .hgignore'
+ hg convert --filemap filemap1 uncorrupt-hg filtered-hg
+ sed -e s/050a1be2ccf20aafa2706cadc1c01a7a8115751a/f7cecd95cba5b02a57d48f8520256254c5d5b44e/ -e s/26bd467e4f79798f48160de2f5f34398571f5237/fe3d8bed6097cfb7a79c22d436168238ab79cfb3/ -e s/85629ffd6bd3ab30a2a67426b2056e88f1c22de3/2731d8112948c405da4ee5e3ecd8a3ae6c9e0ddb/ -e s/a1ef2ea16724cf5b3a11f7ca2b351b9f3e2986b7/7e48b9bca28a775701e6cff1d5f5bc8bd0d0f024/ -e s/7cf3077f939a00457aa4c7a5860b9e64ea42b246/63ca11404699ec52cfa47e34144b966ed978964a/ -e s/15741fa74e8ad85085ce6627e2ce33cd2610eeaa/e4a36a01fc74834a92cfaf2f35c8c96f0e2eaf07/ -e s/3d3545d1dd00dc9269e954a05e2e59a1b4592248/e106bb4cef2473b41b67f1f304b50f40579b1353/ filtered-hg/.hg/shamap
+ mv newshamap filtered-hg/.hg/shamap
+ hg -R old-hg pull -r 2a23f5511857 cwe-ou
+ hg convert --filemap filemap2 old-hg filtered-hg
+ rm -rf filemap1 filemap2 uncorrupt-hg uncorrupt-git
++ hg -R filtered-hg log '--template={node}\n' -d 'Sat Oct 13 00:47:35 2012 +0200'
+ test xa21dd5620cf5fe8a40fdae825987129a4562cbee '!=' xa21dd5620cf5fe8a40fdae825987129a4562cbee
+ git init --bare filtered-git
+ hg -R filtered-hg bookmark -r 6 divergence
+ hg -R filtered-hg push -r divergence filtered-git
+ git --git-dir filtered-git fetch Plasma master
warning: no common commits
remote: Counting objects: 27393, done.
remote: Compressing objects: 100% (6506/6506), done.
remote: Total 27393 (delta 20669), reused 27392 (delta 20669)
Receiving objects: 100% (27393/27393), 26.94 MiB | 6.24 MiB/s, done.
Resolving deltas: 100% (20669/20669), done.
From Plasma
* branch master -> FETCH_HEAD
+ cd filtered-git
+ git branch master FETCH_HEAD
++ cat
++ git log --pretty=format:%H 'divergence^!'
+ DIVERGENCE=a9a69421eb5bdddfd64958991b6d031596b9d07c
+ cat
+ git filter-branch --index-filter 'git rm --cached --ignore-unmatch */plLayerBink.cpp */plLayerBink.h */plBinkPlayer.cpp */plBinkPlayer.h */plBinkBitmap.cpp */plBinkBitmap.h; test `git show :.hgignore 2>/dev/null | wc -c` == 0 && git rm --cached --ignore-unmatch .hgignore' --msg-filter 'cat && git diff --staged --name-status -M75 -l5000 $GIT_COMMIT^ | grep ^R | grep -Ev "pl(LayerBink|BinkPlayer|BinkBitmap)(\.h|\.cpp)" | sed "s/^R[0-9]* \([^ ]*\) \(.*\)$/rename : \1 => \2/" > ../renames && test `cat ../renames | wc -c` -ne 0 && echo && echo "--HG--" && cat ../renames; rm ../renames' --prune-empty --tag-name-filter cat -- --all --not a9a69421eb5bdddfd64958991b6d031596b9d07c
/usr/lib/git-core/git-filter-branch: 1: test: 0: unexpected operator
index filter failed: git rm --cached --ignore-unmatch */plLayerBink.cpp */plLayerBink.h */plBinkPlayer.cpp */plBinkPlayer.h */plBinkBitmap.cpp */plBinkBitmap.h; test `git show :.hgignore 2>/dev/null | wc -c` == 0 && git rm --cached --ignore-unmatch .hgignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment