##// END OF EJS Templates
convert: avoid dirstate checks; add a test...
Alexis S. L. Carvalho -
r5278:70e9a527 default
parent child Browse files
Show More
@@ -0,0 +1,27 b''
1 #!/bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "hgext.convert=" >> $HGRCPATH
5
6 hg init orig
7 cd orig
8 echo foo > foo
9 echo bar > bar
10 hg ci -qAm 'add foo and bar' -d '0 0'
11
12 hg rm foo
13 hg ci -m 'remove foo' -d '0 0'
14
15 mkdir foo
16 echo file > foo/file
17 hg ci -qAm 'add foo/file' -d '0 0'
18
19 hg tag -d '0 0' some-tag
20
21 hg log
22 cd ..
23
24 hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
25 cd new
26 hg out ../orig
27 true
@@ -0,0 +1,33 b''
1 changeset: 3:593cbf6fb2b4
2 tag: tip
3 user: test
4 date: Thu Jan 01 00:00:00 1970 +0000
5 summary: Added tag some-tag for changeset ad681a868e44
6
7 changeset: 2:ad681a868e44
8 tag: some-tag
9 user: test
10 date: Thu Jan 01 00:00:00 1970 +0000
11 summary: add foo/file
12
13 changeset: 1:cbba8ecc03b7
14 user: test
15 date: Thu Jan 01 00:00:00 1970 +0000
16 summary: remove foo
17
18 changeset: 0:327daa9251fa
19 user: test
20 date: Thu Jan 01 00:00:00 1970 +0000
21 summary: add foo and bar
22
23 initializing destination new repository
24 scanning source...
25 sorting...
26 converting...
27 3 add foo and bar
28 2 remove foo
29 1 add foo/file
30 0 Added tag some-tag for changeset ad681a868e44
31 comparing with ../orig
32 searching for changes
33 no changes found
@@ -50,7 +50,7 b' class mercurial_sink(converter_sink):'
50 def putfile(self, f, e, data):
50 def putfile(self, f, e, data):
51 self.repo.wwrite(f, data, e)
51 self.repo.wwrite(f, data, e)
52 if f not in self.repo.dirstate:
52 if f not in self.repo.dirstate:
53 self.repo.dirstate.add(f)
53 self.repo.dirstate.normallookup(f)
54
54
55 def copyfile(self, source, dest):
55 def copyfile(self, source, dest):
56 self.repo.copy(source, dest)
56 self.repo.copy(source, dest)
@@ -111,7 +111,7 b' class mercurial_sink(converter_sink):'
111 p2 = parents.pop(0)
111 p2 = parents.pop(0)
112 a = self.repo.rawcommit(files, text, commit.author, commit.date,
112 a = self.repo.rawcommit(files, text, commit.author, commit.date,
113 bin(p1), bin(p2), extra=extra)
113 bin(p1), bin(p2), extra=extra)
114 self.repo.dirstate.invalidate()
114 self.repo.dirstate.clear()
115 text = "(octopus merge fixup)\n"
115 text = "(octopus merge fixup)\n"
116 p2 = hg.hex(self.repo.changelog.tip())
116 p2 = hg.hex(self.repo.changelog.tip())
117
117
General Comments 0
You need to be logged in to leave comments. Login now