equal
deleted
inserted
replaced
122 if (defined @config::notify_dirs || $opt_initdir) { |
122 if (defined @config::notify_dirs || $opt_initdir) { |
123 check_hg_bin(); |
123 check_hg_bin(); |
124 } |
124 } |
125 |
125 |
126 if ($opt_initdir) { |
126 if ($opt_initdir) { |
|
127 |
127 my $repo = Logbuch::HG->new(repo => $opt_initdir); |
128 my $repo = Logbuch::HG->new(repo => $opt_initdir); |
128 |
129 |
129 $repo->is_repository() |
130 $repo->is_repository() |
130 and die "$ME: directory already initialized, skipping\n"; |
131 and die "$ME: directory already initialized, skipping\n"; |
131 |
132 |
|
133 # any repository is likely to contain sensitive data somewhere |
|
134 my $umask = umask 0077 |
|
135 or die "$ME: Can't set umask: $!"; |
|
136 |
132 $repo->init() |
137 $repo->init() |
133 or die "E: initialization failed\n"; |
138 or die "E: initialization failed\n"; |
|
139 |
|
140 umask $umask |
|
141 or warn "$ME: Can't restore umask: $!"; |
134 |
142 |
135 $repo->addremove(); |
143 $repo->addremove(); |
136 $repo->commit("initial check in"); |
144 $repo->commit("initial check in"); |
137 |
145 |
138 exit 0; |
146 exit 0; |