Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgMergeState.java @ 415:ee8264d80747
Explicit constant for regular file flags, access to flags for a given file revision
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Thu, 22 Mar 2012 18:54:11 +0100 |
| parents | 2fadf8695f8a |
| children | 9c9c442b5f2e |
comparison
equal
deleted
inserted
replaced
| 414:bb278ccf9866 | 415:ee8264d80747 |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2012 TMate Software Ltd |
| 3 * | 3 * |
| 4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
| 5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
| 6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
| 7 * | 7 * |
| 125 while ((s = br.readLine()) != null) { | 125 while ((s = br.readLine()) != null) { |
| 126 String[] r = s.split("\\00"); | 126 String[] r = s.split("\\00"); |
| 127 Path p1fname = pathPool.path(r[3]); | 127 Path p1fname = pathPool.path(r[3]); |
| 128 Nodeid nidP1 = m1.nodeid(p1fname); | 128 Nodeid nidP1 = m1.nodeid(p1fname); |
| 129 Nodeid nidCA = nodeidPool.unify(Nodeid.fromAscii(r[5])); | 129 Nodeid nidCA = nodeidPool.unify(Nodeid.fromAscii(r[5])); |
| 130 HgFileRevision p1 = new HgFileRevision(repo, nidP1, p1fname); | 130 HgFileRevision p1 = new HgFileRevision(repo, nidP1, m1.flags(p1fname), p1fname); |
| 131 HgFileRevision ca; | 131 HgFileRevision ca; |
| 132 if (nidCA == nidP1 && r[3].equals(r[4])) { | 132 if (nidCA == nidP1 && r[3].equals(r[4])) { |
| 133 ca = p1; | 133 ca = p1; |
| 134 } else { | 134 } else { |
| 135 ca = new HgFileRevision(repo, nidCA, pathPool.path(r[4])); | 135 ca = new HgFileRevision(repo, nidCA, null, pathPool.path(r[4])); |
| 136 } | 136 } |
| 137 HgFileRevision p2; | 137 HgFileRevision p2; |
| 138 if (!wcp2.isNull() || !r[6].equals(r[4])) { | 138 if (!wcp2.isNull() || !r[6].equals(r[4])) { |
| 139 final Path p2fname = pathPool.path(r[6]); | 139 final Path p2fname = pathPool.path(r[6]); |
| 140 Nodeid nidP2 = m2.nodeid(p2fname); | 140 Nodeid nidP2 = m2.nodeid(p2fname); |
| 141 if (nidP2 == null) { | 141 if (nidP2 == null) { |
| 142 assert false : "There's not enough information (or I don't know where to look) in merge/state to find out what's the second parent"; | 142 assert false : "There's not enough information (or I don't know where to look) in merge/state to find out what's the second parent"; |
| 143 nidP2 = NULL; | 143 nidP2 = NULL; |
| 144 } | 144 } |
| 145 p2 = new HgFileRevision(repo, nidP2, p2fname); | 145 p2 = new HgFileRevision(repo, nidP2, m2.flags(p2fname), p2fname); |
| 146 } else { | 146 } else { |
| 147 // no second parent known. no idea what to do here, assume linear merge, use common ancestor as parent | 147 // no second parent known. no idea what to do here, assume linear merge, use common ancestor as parent |
| 148 p2 = ca; | 148 p2 = ca; |
| 149 } | 149 } |
| 150 final Kind k; | 150 final Kind k; |
