Mercurial > hg4j
annotate src/org/tmatesoft/hg/repo/ext/Rebase.java @ 626:5afc7eedb3dd v1.1rc1
@since, TODOs. Tests: add 1 sec to deal with fs timestamp granularity on linux
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 21 May 2013 19:30:12 +0200 |
parents | d2f6ab541330 |
children | 6526d8adbc0f |
rev | line source |
---|---|
501
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012 TMate Software Ltd |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.repo.ext; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 import java.io.File; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 import java.util.ArrayList; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 import java.util.HashMap; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 import java.util.Iterator; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 import java.util.Map; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 import java.util.NoSuchElementException; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 import org.tmatesoft.hg.core.HgBadNodeidFormatException; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 import org.tmatesoft.hg.core.HgIOException; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 import org.tmatesoft.hg.core.Nodeid; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 import org.tmatesoft.hg.internal.Internals; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 import org.tmatesoft.hg.internal.LineReader; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 import org.tmatesoft.hg.repo.HgInvalidFileException; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 import org.tmatesoft.hg.repo.HgInvalidStateException; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 /** |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 * Support for standard Rebase extension. |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 * |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 * @see http://mercurial.selenic.com/wiki/RebaseExtension |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 * @since 1.1 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
39 * @author Artem Tikhomirov |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
40 * @author TMate Software Ltd. |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
41 */ |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
42 public class Rebase { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 private Internals repo; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 private Nodeid workingDirParent; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
45 private Nodeid destRevision; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
46 private Nodeid externalParent; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
47 private Map<Nodeid, Nodeid> state; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
48 private boolean collapse; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
49 private boolean keepOriginalRevisions; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
50 private boolean keepBranchNames; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
51 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
52 /*package-local*/ Rebase(Internals internalRepo) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
53 repo = internalRepo; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
54 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
55 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
56 public Rebase refresh() throws HgIOException { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
57 workingDirParent = null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
58 destRevision = null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
59 externalParent = null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
60 state = null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
61 File f = repo.getFileFromRepoDir("rebasestate"); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
62 if (!f.exists()) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
63 return this; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
64 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
65 state = new HashMap<Nodeid, Nodeid>(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
66 try { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
67 LineReader lr = new LineReader(f, repo.getSessionContext().getLog()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
68 ArrayList<String> contents = new ArrayList<String>(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
69 lr.read(new LineReader.SimpleLineCollector(), contents); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
70 Iterator<String> it = contents.iterator(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
71 workingDirParent = Nodeid.fromAscii(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
72 destRevision = Nodeid.fromAscii(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
73 externalParent = Nodeid.fromAscii(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
74 collapse = "1".equals(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
75 keepOriginalRevisions = "1".equals(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
76 keepBranchNames = "1".equals(it.next()); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
77 final String nullmerge = "-2"; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
78 while (it.hasNext()) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
79 String line = it.next(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
80 int x = line.indexOf(':'); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
81 if (x == -1) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
82 throw new HgInvalidStateException(line); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
83 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
84 Nodeid oldRev = Nodeid.fromAscii(line.substring(0, x)); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
85 Nodeid newRev; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
86 if (line.regionMatches(x+1, nullmerge, 0, nullmerge.length())) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
87 newRev = null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
88 } else { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
89 newRev = Nodeid.fromAscii(line.substring(x+1)); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
90 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
91 state.put(oldRev, newRev); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
92 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
93 } catch (NoSuchElementException ex) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
94 throw new HgIOException("Bad format of rebase state file", f); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
95 } catch (HgBadNodeidFormatException ex) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
96 throw new HgIOException("Bad format of rebase state file", ex, f); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
97 } catch (HgInvalidFileException ex) { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
98 throw new HgIOException("Bad format of rebase state file", ex, f); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
99 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
100 return this; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
101 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
102 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
103 /** |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
104 * Tells whether rebase process was interrupted to manually resolve a merge |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
105 * and can be resumed or aborted. |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
106 * |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
107 * @return <code>true</code> when rebase is in progress |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
108 */ |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
109 public boolean isRebaseInProgress() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
110 return state != null; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
111 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
112 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
113 public Nodeid getWorkingDirParent() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
114 assert isRebaseInProgress(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
115 return workingDirParent; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
116 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
117 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
118 public Nodeid getTarget() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
119 assert isRebaseInProgress(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
120 return destRevision; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
121 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
122 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
123 public Nodeid getExternalParent() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
124 assert isRebaseInProgress(); |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
125 assert collapse; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
126 return externalParent; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
127 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
128 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
129 public boolean isCollapse() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
130 return collapse; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
131 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
132 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
133 public boolean isKeepOriginalRevisions() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
134 return keepOriginalRevisions; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
135 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
136 |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
137 public boolean isKeepBranchNames() { |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
138 return keepBranchNames; |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
139 } |
d2f6ab541330
Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
140 } |