annotate test/org/tmatesoft/hg/test/TestBundle.java @ 668:d25f0324a27a

Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 11 Jul 2013 18:41:40 +0200
parents
children
rev   line source
668
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
1 /*
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2013 TMate Software Ltd
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
3 *
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
6 * the Free Software Foundation; version 2 of the License.
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
7 *
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
11 * GNU General Public License for more details.
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
12 *
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
13 * For information on how to redistribute this software under
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
14 * the terms of a license other than GNU General Public License
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
15 * contact TMate Software at support@hg4j.com
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
16 */
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
17 package org.tmatesoft.hg.test;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
18
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
19 import static org.junit.Assert.*;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
20
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
21 import java.io.File;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
22 import java.util.ArrayList;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
23 import java.util.Arrays;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
24 import java.util.Collections;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
25 import java.util.HashMap;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
26 import java.util.List;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
27 import java.util.Map;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
28
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
29 import org.junit.Rule;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
30 import org.junit.Test;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
31 import org.tmatesoft.hg.core.Nodeid;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
32 import org.tmatesoft.hg.internal.BundleGenerator;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
33 import org.tmatesoft.hg.repo.HgBundle;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
34 import org.tmatesoft.hg.repo.HgBundle.GroupElement;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
35 import org.tmatesoft.hg.repo.HgInternals;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
36 import org.tmatesoft.hg.repo.HgLookup;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
37 import org.tmatesoft.hg.repo.HgRepository;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
38 import org.tmatesoft.hg.repo.HgRuntimeException;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
39
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
40 /**
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
41 *
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
42 * @author Artem Tikhomirov
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
43 * @author TMate Software Ltd.
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
44 */
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
45 public class TestBundle {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
46 @Rule
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
47 public ErrorCollectorExt errorCollector = new ErrorCollectorExt();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
48
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
49 @Test
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
50 public void testCreateBundle() throws Exception {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
51 final HgRepository hgRepo = Configuration.get().own();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
52 BundleGenerator bg = new BundleGenerator(HgInternals.getImplementationRepo(hgRepo));
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
53 ArrayList<Nodeid> l = new ArrayList<Nodeid>();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
54 l.add(Nodeid.fromAscii("9ef1fab9f5e3d51d70941121dc27410e28069c2d")); // 640
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
55 l.add(Nodeid.fromAscii("2f33f102a8fa59274a27ebbe1c2903cecac6c5d5")); // 639
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
56 l.add(Nodeid.fromAscii("d074971287478f69ab0a64176ce2284d8c1e91c3")); // 638
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
57 File bundleFile = bg.create(l);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
58 HgBundle b = new HgLookup().loadBundle(bundleFile);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
59 //
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
60 DumbInspector insp = new DumbInspector();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
61 b.inspectChangelog(insp);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
62 errorCollector.assertTrue(insp.clogEnter && insp.clogExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
63 errorCollector.assertFalse(insp.csets.isEmpty());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
64 errorCollector.assertFalse(insp.manifestEnter || insp.manifestExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
65 Collections.sort(l);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
66 Collections.sort(insp.csets);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
67 errorCollector.assertEquals(l, insp.csets);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
68 errorCollector.assertEquals(0, insp.filesEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
69 errorCollector.assertEquals(0, insp.filesExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
70 errorCollector.assertTrue(insp.manifests == null || insp.manifests.isEmpty());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
71 errorCollector.assertTrue(insp.files.isEmpty());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
72 //
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
73 insp = new DumbInspector();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
74 b.inspectFiles(insp);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
75 errorCollector.assertFalse(insp.clogEnter && insp.clogExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
76 errorCollector.assertFalse(insp.manifestEnter || insp.manifestExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
77 // $ hg log -r 638:640 --debug | grep files
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
78 List<String> affectedFiles = Arrays.asList("src/org/tmatesoft/hg/repo/HgDataFile.java", "COPYING", "build.gradle", ".hgtags");
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
79 // "src/org/tmatesoft/hg/repo/HgBlameInspector.java" was deleted in r638 and hence not part of the bundle
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
80 ArrayList<String> foundFiles = new ArrayList<String>(insp.files.keySet());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
81 Collections.sort(affectedFiles);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
82 Collections.sort(foundFiles);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
83 errorCollector.assertEquals(affectedFiles, foundFiles);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
84 errorCollector.assertEquals(affectedFiles.size(), insp.filesEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
85 errorCollector.assertEquals(affectedFiles.size(), insp.filesExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
86 b.unlink();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
87 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
88
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
89 private static class DumbInspector implements HgBundle.Inspector {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
90 public boolean clogEnter, clogExit, manifestEnter, manifestExit;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
91 public int filesEnter, filesExit;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
92 public List<Nodeid> csets, manifests;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
93 public Map<String, List<Nodeid>> files = new HashMap<String, List<Nodeid>>();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
94 private List<Nodeid> actual;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
95
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
96 public void changelogStart() throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
97 assertFalse(clogEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
98 assertFalse(clogExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
99 clogEnter = true;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
100 actual = csets = new ArrayList<Nodeid>();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
101 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
102
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
103 public void changelogEnd() throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
104 assertTrue(clogEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
105 assertFalse(clogExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
106 clogExit = true;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
107 actual = null;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
108 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
109
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
110 public void manifestStart() throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
111 assertFalse(manifestEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
112 assertFalse(manifestExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
113 manifestEnter = true;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
114 actual = manifests = new ArrayList<Nodeid>();
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
115 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
116
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
117 public void manifestEnd() throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
118 assertTrue(manifestEnter);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
119 assertFalse(manifestExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
120 manifestExit = true;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
121 actual = null;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
122 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
123
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
124 public void fileStart(String name) throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
125 assertEquals(filesEnter, filesExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
126 filesEnter++;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
127 files.put(name, actual = new ArrayList<Nodeid>());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
128 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
129
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
130 public void fileEnd(String name) throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
131 assertEquals(filesEnter, 1 + filesExit);
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
132 filesExit++;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
133 actual = null;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
134 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
135
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
136 public boolean element(GroupElement element) throws HgRuntimeException {
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
137 actual.add(element.node());
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
138 return true;
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
139 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
140 }
d25f0324a27a Delete bundle with push/pull changes once command completes successfully. Test for bundle generator
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
141 }