##// END OF EJS Templates
merge with crew-stable
Thomas Arendsen Hein -
r3920:b12eae71 merge default
parent child Browse files
Show More
@@ -6,19 +6,20 b''
6 # In its current form, it's hardcoded to convert incrementally between
6 # In its current form, it's hardcoded to convert incrementally between
7 # git and Mercurial.
7 # git and Mercurial.
8 #
8 #
9 # To use, you must first import the first git version into Mercurial,
9 # To use, run:
10 # and establish a mapping between the git commit hash and the hash in
10 #
11 # Mercurial for that version. This mapping is kept in a simple text
11 # convert-repo <git-dir> <hg-dir> <mapfile>
12 # file with lines like so:
12 #
13 # (don't forget to create the <hg-dir> repository beforehand)
14 #
15 # The <mapfile> is a simple text file that maps a git commit hash to
16 # the hash in Mercurial for that version, like so:
13 #
17 #
14 # <git hash> <mercurial hash>
18 # <git hash> <mercurial hash>
15 #
19 #
16 # To convert the rest of the repo, run:
20 # If the file doesn't exist, it's automatically created. It's updated
17 #
21 # on each commit copied, so convert-repo can be interrupted and can
18 # convert-repo <git-dir> <hg-dir> <mapfile>
22 # be run repeatedly to copy new commits.
19 #
20 # This updates the mapfile on each commit copied, so it can be
21 # interrupted and can be run repeatedly to copy new commits.
22
23
23 import sys, os, zlib, sha, time
24 import sys, os, zlib, sha, time
24
25
@@ -85,7 +86,7 b' class convert_git:'
85 committer = " ".join(p[:-2])
86 committer = " ".join(p[:-2])
86 if committer[0] == "<": committer = committer[1:-1]
87 if committer[0] == "<": committer = committer[1:-1]
87 committer = recode(committer)
88 committer = recode(committer)
88 message += "\ncommitter: %s\n" % v
89 message += "\ncommitter: %s\n" % committer
89 if n == "parent": parents.append(v)
90 if n == "parent": parents.append(v)
90
91
91 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
92 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
@@ -295,7 +296,8 b' class convert:'
295 nrev = self.dest.puttags(ctags)
296 nrev = self.dest.puttags(ctags)
296 # write another hash correspondence to override the previous
297 # write another hash correspondence to override the previous
297 # one so we don't end up with extra tag heads
298 # one so we don't end up with extra tag heads
298 file(self.mapfile, "a").write("%s %s\n" % (c, nrev))
299 if nrev:
300 file(self.mapfile, "a").write("%s %s\n" % (c, nrev))
299
301
300 gitpath, hgpath, mapfile = sys.argv[1:]
302 gitpath, hgpath, mapfile = sys.argv[1:]
301 if os.path.isdir(gitpath + "/.git"):
303 if os.path.isdir(gitpath + "/.git"):
@@ -194,14 +194,25 b' def keystr(ui, key):'
194 return user
194 return user
195
195
196 def sign(ui, repo, *revs, **opts):
196 def sign(ui, repo, *revs, **opts):
197 """add a signature for the current tip or a given revision"""
197 """add a signature for the current or given revision
198
199 If no revision is given, the parent of the working directory is used,
200 or tip if no revision is checked out.
201 """
202
198 mygpg = newgpg(ui, **opts)
203 mygpg = newgpg(ui, **opts)
199 sigver = "0"
204 sigver = "0"
200 sigmessage = ""
205 sigmessage = ""
201 if revs:
206 if revs:
202 nodes = [repo.lookup(n) for n in revs]
207 nodes = [repo.lookup(n) for n in revs]
203 else:
208 else:
204 nodes = [repo.changelog.tip()]
209 nodes = [node for node in repo.dirstate.parents()
210 if node != hgnode.nullid]
211 if len(nodes) > 1:
212 raise util.Abort(_('uncommitted merge - please provide a '
213 'specific revision'))
214 if not nodes:
215 nodes = [repo.changelog.tip()]
205
216
206 for n in nodes:
217 for n in nodes:
207 hexnode = hgnode.hex(n)
218 hexnode = hgnode.hex(n)
@@ -338,11 +338,11 b' def bundle(ui, repo, fname, dest=None, *'
338 changegroup.writebundle(cg, fname, "HG10BZ")
338 changegroup.writebundle(cg, fname, "HG10BZ")
339
339
340 def cat(ui, repo, file1, *pats, **opts):
340 def cat(ui, repo, file1, *pats, **opts):
341 """output the latest or given revisions of files
341 """output the current or given revision of files
342
342
343 Print the specified files as they were at the given revision.
343 Print the specified files as they were at the given revision.
344 If no revision is given then working dir parent is used, or tip
344 If no revision is given, the parent of the working directory is used,
345 if no revision is checked out.
345 or tip if no revision is checked out.
346
346
347 Output may be to a file, in which case the name of the file is
347 Output may be to a file, in which case the name of the file is
348 given using a format string. The formatting rules are the same as
348 given using a format string. The formatting rules are the same as
@@ -1739,9 +1739,11 b' def log(ui, repo, *pats, **opts):'
1739 count += 1
1739 count += 1
1740
1740
1741 def manifest(ui, repo, rev=None):
1741 def manifest(ui, repo, rev=None):
1742 """output the latest or given revision of the project manifest
1742 """output the current or given revision of the project manifest
1743
1743
1744 Print a list of version controlled files for the given revision.
1744 Print a list of version controlled files for the given revision.
1745 If no revision is given, the parent of the working directory is used,
1746 or tip if no revision is checked out.
1745
1747
1746 The manifest is the list of files being version controlled. If no revision
1748 The manifest is the list of files being version controlled. If no revision
1747 is given then the first parent of the working directory is used.
1749 is given then the first parent of the working directory is used.
@@ -2398,7 +2400,7 b' def status(ui, repo, *pats, **opts):'
2398 ui.write(' %s%s' % (copied, end))
2400 ui.write(' %s%s' % (copied, end))
2399
2401
2400 def tag(ui, repo, name, rev_=None, **opts):
2402 def tag(ui, repo, name, rev_=None, **opts):
2401 """add a tag for the current tip or a given revision
2403 """add a tag for the current or given revision
2402
2404
2403 Name a particular revision using <name>.
2405 Name a particular revision using <name>.
2404
2406
@@ -2406,7 +2408,8 b' def tag(ui, repo, name, rev_=None, **opt'
2406 very useful to compare different revision, to go back to significant
2408 very useful to compare different revision, to go back to significant
2407 earlier versions or to mark branch points as releases, etc.
2409 earlier versions or to mark branch points as releases, etc.
2408
2410
2409 If no revision is given, the parent of the working directory is used.
2411 If no revision is given, the parent of the working directory is used,
2412 or tip if no revision is checked out.
2410
2413
2411 To facilitate version control, distribution, and merging of tags,
2414 To facilitate version control, distribution, and merging of tags,
2412 they are stored as a file named ".hgtags" which is managed
2415 they are stored as a file named ".hgtags" which is managed
@@ -24,7 +24,6 b' helptable = {'
24 "12-6"
24 "12-6"
25 "12/6"
25 "12/6"
26 "12/6/6" (Dec 6 2006)
26 "12/6/6" (Dec 6 2006)
27 "" (Jan 1 00:00:00 1970 UTC)
28
27
29 Lastly, there is Mercurial's internal format:
28 Lastly, there is Mercurial's internal format:
30
29
@@ -125,7 +125,7 b' list of commands (use "hg help -v" to sh'
125 branch set or show the current branch name
125 branch set or show the current branch name
126 branches list repository named branches
126 branches list repository named branches
127 bundle create a changegroup file
127 bundle create a changegroup file
128 cat output the latest or given revisions of files
128 cat output the current or given revision of files
129 clone make a copy of an existing repository
129 clone make a copy of an existing repository
130 commit commit the specified files or all outstanding changes
130 commit commit the specified files or all outstanding changes
131 copy mark files as copied for the next commit
131 copy mark files as copied for the next commit
@@ -140,7 +140,7 b' list of commands (use "hg help -v" to sh'
140 init create a new repository in the given directory
140 init create a new repository in the given directory
141 locate locate files matching specific patterns
141 locate locate files matching specific patterns
142 log show revision history of entire repository or files
142 log show revision history of entire repository or files
143 manifest output the latest or given revision of the project manifest
143 manifest output the current or given revision of the project manifest
144 merge Merge working directory with another revision
144 merge Merge working directory with another revision
145 outgoing show changesets not found in destination
145 outgoing show changesets not found in destination
146 parents show the parents of the working dir or revision
146 parents show the parents of the working dir or revision
@@ -156,7 +156,7 b' list of commands (use "hg help -v" to sh'
156 serve export the repository via HTTP
156 serve export the repository via HTTP
157 showconfig show combined config settings from all hgrc files
157 showconfig show combined config settings from all hgrc files
158 status show changed files in the working directory
158 status show changed files in the working directory
159 tag add a tag for the current tip or a given revision
159 tag add a tag for the current or given revision
160 tags list repository tags
160 tags list repository tags
161 tip show the tip revision
161 tip show the tip revision
162 unbundle apply a changegroup file
162 unbundle apply a changegroup file
@@ -175,7 +175,7 b' list of commands (use "hg help -v" to sh'
175 branch set or show the current branch name
175 branch set or show the current branch name
176 branches list repository named branches
176 branches list repository named branches
177 bundle create a changegroup file
177 bundle create a changegroup file
178 cat output the latest or given revisions of files
178 cat output the current or given revision of files
179 clone make a copy of an existing repository
179 clone make a copy of an existing repository
180 commit commit the specified files or all outstanding changes
180 commit commit the specified files or all outstanding changes
181 copy mark files as copied for the next commit
181 copy mark files as copied for the next commit
@@ -190,7 +190,7 b' list of commands (use "hg help -v" to sh'
190 init create a new repository in the given directory
190 init create a new repository in the given directory
191 locate locate files matching specific patterns
191 locate locate files matching specific patterns
192 log show revision history of entire repository or files
192 log show revision history of entire repository or files
193 manifest output the latest or given revision of the project manifest
193 manifest output the current or given revision of the project manifest
194 merge Merge working directory with another revision
194 merge Merge working directory with another revision
195 outgoing show changesets not found in destination
195 outgoing show changesets not found in destination
196 parents show the parents of the working dir or revision
196 parents show the parents of the working dir or revision
@@ -206,7 +206,7 b' list of commands (use "hg help -v" to sh'
206 serve export the repository via HTTP
206 serve export the repository via HTTP
207 showconfig show combined config settings from all hgrc files
207 showconfig show combined config settings from all hgrc files
208 status show changed files in the working directory
208 status show changed files in the working directory
209 tag add a tag for the current tip or a given revision
209 tag add a tag for the current or given revision
210 tags list repository tags
210 tags list repository tags
211 tip show the tip revision
211 tip show the tip revision
212 unbundle apply a changegroup file
212 unbundle apply a changegroup file
@@ -46,7 +46,7 b' list of commands (use "hg help -v" to sh'
46 branch set or show the current branch name
46 branch set or show the current branch name
47 branches list repository named branches
47 branches list repository named branches
48 bundle create a changegroup file
48 bundle create a changegroup file
49 cat output the latest or given revisions of files
49 cat output the current or given revision of files
50 clone make a copy of an existing repository
50 clone make a copy of an existing repository
51 commit commit the specified files or all outstanding changes
51 commit commit the specified files or all outstanding changes
52 copy mark files as copied for the next commit
52 copy mark files as copied for the next commit
@@ -61,7 +61,7 b' list of commands (use "hg help -v" to sh'
61 init create a new repository in the given directory
61 init create a new repository in the given directory
62 locate locate files matching specific patterns
62 locate locate files matching specific patterns
63 log show revision history of entire repository or files
63 log show revision history of entire repository or files
64 manifest output the latest or given revision of the project manifest
64 manifest output the current or given revision of the project manifest
65 merge Merge working directory with another revision
65 merge Merge working directory with another revision
66 outgoing show changesets not found in destination
66 outgoing show changesets not found in destination
67 parents show the parents of the working dir or revision
67 parents show the parents of the working dir or revision
@@ -77,7 +77,7 b' list of commands (use "hg help -v" to sh'
77 serve export the repository via HTTP
77 serve export the repository via HTTP
78 showconfig show combined config settings from all hgrc files
78 showconfig show combined config settings from all hgrc files
79 status show changed files in the working directory
79 status show changed files in the working directory
80 tag add a tag for the current tip or a given revision
80 tag add a tag for the current or given revision
81 tags list repository tags
81 tags list repository tags
82 tip show the tip revision
82 tip show the tip revision
83 unbundle apply a changegroup file
83 unbundle apply a changegroup file
@@ -92,7 +92,7 b' list of commands (use "hg help -v" to sh'
92 branch set or show the current branch name
92 branch set or show the current branch name
93 branches list repository named branches
93 branches list repository named branches
94 bundle create a changegroup file
94 bundle create a changegroup file
95 cat output the latest or given revisions of files
95 cat output the current or given revision of files
96 clone make a copy of an existing repository
96 clone make a copy of an existing repository
97 commit commit the specified files or all outstanding changes
97 commit commit the specified files or all outstanding changes
98 copy mark files as copied for the next commit
98 copy mark files as copied for the next commit
@@ -107,7 +107,7 b' list of commands (use "hg help -v" to sh'
107 init create a new repository in the given directory
107 init create a new repository in the given directory
108 locate locate files matching specific patterns
108 locate locate files matching specific patterns
109 log show revision history of entire repository or files
109 log show revision history of entire repository or files
110 manifest output the latest or given revision of the project manifest
110 manifest output the current or given revision of the project manifest
111 merge Merge working directory with another revision
111 merge Merge working directory with another revision
112 outgoing show changesets not found in destination
112 outgoing show changesets not found in destination
113 parents show the parents of the working dir or revision
113 parents show the parents of the working dir or revision
@@ -123,7 +123,7 b' list of commands (use "hg help -v" to sh'
123 serve export the repository via HTTP
123 serve export the repository via HTTP
124 showconfig show combined config settings from all hgrc files
124 showconfig show combined config settings from all hgrc files
125 status show changed files in the working directory
125 status show changed files in the working directory
126 tag add a tag for the current tip or a given revision
126 tag add a tag for the current or given revision
127 tags list repository tags
127 tags list repository tags
128 tip show the tip revision
128 tip show the tip revision
129 unbundle apply a changegroup file
129 unbundle apply a changegroup file
@@ -10,7 +10,4 b' Q=$!'
10 sleep 3
10 sleep 3
11 kill -HUP $P
11 kill -HUP $P
12 wait
12 wait
13 ls -R .hg
13 echo .hg/* .hg/store/*
14
15
16
@@ -4,11 +4,4 b' adding changesets'
4 killed!
4 killed!
5 transaction abort!
5 transaction abort!
6 rollback completed
6 rollback completed
7 .hg:
7 .hg/00changelog.i .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i
8 00changelog.i
9 journal.dirstate
10 requires
11 store
12
13 .hg/store:
14 00changelog.i
General Comments 0
You need to be logged in to leave comments. Login now