Attachment 'Win32hidehg.py'

Download

   1 # win32hideHg.py    Hide the .hg directory on Windows
   2 #
   3 # Copyright (C) 2008 Simon Heimberg <simohe at besonet. dot ch>
   4 #
   5 # This program is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License as published by the
   7 # Free Software Foundation; either version 2 of the License, or (at your
   8 # option) any later version.
   9 #
  10 # This program is distributed in the hope that it will be useful, but
  11 # WITHOUT ANY WARRANTY; without even the implied warranty of
  12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
  13 # Public License for more details.
  14 #
  15 # You should have received a copy of the GNU General Public License along
  16 # with this program; if not, write to the Free Software Foundation, Inc.,
  17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18 
  19 '''
  20 Extension win32hideHg
  21 
  22 Hides the .hg directory
  23 Only for Windows
  24 '''
  25 
  26 # Problem:
  27 # does not hide the directory on creation, but on the next command. Why?
  28 
  29 def reposetup(ui, repo):
  30     try:
  31         import win32con, win32api
  32         # make the file hidden
  33         win32api.SetFileAttributes(repo.path, win32con.FILE_ATTRIBUTE_HIDDEN)
  34     except :
  35         # only warn, stopping is not desired
  36         # provide more information?
  37         ui.warn('Error in Win32hideHg\n')

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-10-10 08:41:39, 1.3 KB) [[attachment:Win32hidehg.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.