Mercurial > jhg
comparison src/org/tmatesoft/hg/core/HgStatus.java @ 354:5f9073eabf06
Propagate errors with exceptions up to a end client
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 01 Dec 2011 05:21:40 +0100 |
parents | f052f40839ec |
children | 528b6780a8bd |
comparison
equal
deleted
inserted
replaced
353:0f3687e79f5a | 354:5f9073eabf06 |
---|---|
69 } | 69 } |
70 | 70 |
71 /** | 71 /** |
72 * @return <code>null</code> if author for the change can't be deduced (e.g. for clean files it's senseless) | 72 * @return <code>null</code> if author for the change can't be deduced (e.g. for clean files it's senseless) |
73 */ | 73 */ |
74 public String getModificationAuthor() { | 74 public String getModificationAuthor() throws HgInvalidControlFileException { |
75 RawChangeset cset = logHelper.findLatestChangeWith(path); | 75 RawChangeset cset = logHelper.findLatestChangeWith(path); |
76 if (cset == null) { | 76 if (cset == null) { |
77 if (kind == Kind.Modified || kind == Kind.Added || kind == Kind.Removed /*&& RightBoundary is TIP*/) { | 77 if (kind == Kind.Modified || kind == Kind.Added || kind == Kind.Removed /*&& RightBoundary is TIP*/) { |
78 // perhaps, also for Kind.Missing? | 78 // perhaps, also for Kind.Missing? |
79 return logHelper.getNextCommitUsername(); | 79 return logHelper.getNextCommitUsername(); |
82 return cset.user(); | 82 return cset.user(); |
83 } | 83 } |
84 return null; | 84 return null; |
85 } | 85 } |
86 | 86 |
87 public Date getModificationDate() { | 87 public Date getModificationDate() throws HgInvalidControlFileException { |
88 RawChangeset cset = logHelper.findLatestChangeWith(path); | 88 RawChangeset cset = logHelper.findLatestChangeWith(path); |
89 if (cset == null) { | 89 if (cset == null) { |
90 File localFile = new File(logHelper.getRepo().getWorkingDir(), path.toString()); | 90 File localFile = new File(logHelper.getRepo().getWorkingDir(), path.toString()); |
91 if (localFile.canRead()) { | 91 if (localFile.canRead()) { |
92 return new Date(localFile.lastModified()); | 92 return new Date(localFile.lastModified()); |