comparison src/org/tmatesoft/hg/repo/HgInternals.java @ 269:7af843ecc378

Respect glob pattern with alternatives {a,b}
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 23 Aug 2011 23:47:38 +0200
parents 6e1373b54e9b
children 7232b94f2ae3
comparison
equal deleted inserted replaced
268:c5980f287cc4 269:7af843ecc378
16 */ 16 */
17 package org.tmatesoft.hg.repo; 17 package org.tmatesoft.hg.repo;
18 18
19 import static org.tmatesoft.hg.repo.HgRepository.*; 19 import static org.tmatesoft.hg.repo.HgRepository.*;
20 20
21 import java.io.BufferedReader;
21 import java.io.File; 22 import java.io.File;
23 import java.io.IOException;
24 import java.io.Reader;
22 import java.net.InetAddress; 25 import java.net.InetAddress;
23 import java.net.UnknownHostException; 26 import java.net.UnknownHostException;
24 27
25 import org.tmatesoft.hg.internal.ConfigFile; 28 import org.tmatesoft.hg.internal.ConfigFile;
26 import org.tmatesoft.hg.internal.Experimental; 29 import org.tmatesoft.hg.internal.Experimental;
67 } 70 }
68 71
69 public ConfigFile getRepoConfig() { 72 public ConfigFile getRepoConfig() {
70 return repo.getConfigFile(); 73 return repo.getConfigFile();
71 } 74 }
75
76 public static HgIgnore newHgIgnore(Reader source) throws IOException {
77 HgIgnore hgIgnore = new HgIgnore();
78 BufferedReader br = source instanceof BufferedReader ? (BufferedReader) source : new BufferedReader(source);
79 hgIgnore.read(br);
80 br.close();
81 return hgIgnore;
82 }
72 83
73 // in fact, need a setter for this anyway, shall move to internal.Internals perhaps? 84 // in fact, need a setter for this anyway, shall move to internal.Internals perhaps?
74 public String getNextCommitUsername() { 85 public String getNextCommitUsername() {
75 String hgUser = System.getenv("HGUSER"); 86 String hgUser = System.getenv("HGUSER");
76 if (hgUser != null && hgUser.trim().length() > 0) { 87 if (hgUser != null && hgUser.trim().length() > 0) {