-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
87 lines (53 loc) · 2.67 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
hg2svn - Converts a Mercurial repo into a Subversion one.
Features:
+ Converts mercurial repositories into subversion ones.
+ Migrate revisions and commit logs
+ Support incremental runs via parameters. (init or sync)
Potential issues for reuse:
- incomplete sanity checks.
- no handling of branches
- certain layout of the results of hg commands is assumed
- all commits come from the user running the script
- move operations probably won't appear in the history as such
- we assume the SVN side doesn't change
How to use:
Edit config.ini and add the temp_path (working directory)
Usage:
First we need to initialize repositories:
hg2svn.php init <mercurial_repo_src> <svn_target_repo>
Now to sync! :
hg2svn.php init <svn_target_repo>
Real world example:
I have already cloned dclib_hg to /home/psteyn/dclib_hg/ and I have a new svn repo called /home/psteyn/svnrepo
(Both local and remote URI's can be given)
To sync dclib_hg to /home/psteyn/svnrepo:
php hg2svn.php init /home/psteyn/dclib_hg/ file:///home/psteyn/svnrepo
Succesfully created /var/tmp/hg2svn/
Cloning Mercurial repository at /home/psteyn/dclib_hg/ into Mercurial working copy at /var/tmp/hg2svn/hg2svntq8JFt_hg.
Checking out file:///home/psteyn/svnrepo as /var/tmp/hg2svn/hg2svntq8JFt_svn
Converting Mercurial repository at /var/tmp/hg2svn/hg2svntq8JFt_hg into Subversion working copy at /var/tmp/hg2svn/hg2svntq8JFt_svn.
Succesfully initialized. Ready for sync.
psteyn@elegua:~/hg2svn$ php hg2svn.php sync file:///home/psteyn/svnrepo
Ensuring SVN repo is up to date before sync.
Ensuring HG repo is up to date before sync.
Fetching Mercurial revision 1/2178
- removing deleted files
- removing empty directories
- adding files to SVN control
--snip--
Win32 running:
--------------
- You need PHP (obviously), mercurial, svn & patch.
The links for these:
--------------------
HG: http://mercurial.selenic.com/downloads/ [ I took MSI installer ]
SVN: http://www.sliksvn.com/en/download
patch: https://sourceforge.net/projects/gnuwin32/files/patch/ [Just take latest version + read below if you're on Win Vista/7]
Hint for patch under UAE:
-------------------------
http://jameswynn.com/2010/03/gnu-patch-in-windows-7-or-vista/
I just had a little fight with Windows 7 about permissions. It seems that it demands that any executable with the word "patch" in the name must be run with administrative privileges. After fighting with it for a few minutes about the absurdity of the problem, I resorted to a simple hack.
Rename patch.exe to patsh.exe.
Then create patch.bat in the same directory containing the following command:
@patsh.exe %*
You will never notice a difference, and Windows 7 can go politely F*** itself.