hg repository를 사용하다 보면

하위 폴더 하나를 빼버리고 싶을때도 있고,
하위 폴더 하나를 또 다른 repository로 만들고 싶을 때도 있다.
위의 두개를 조합해서 sub repository로 경로를 분산하고자 할때도 있다.

이럴때, hg convert extension을 사용하면 된다.

http://mercurial.selenic.com/wiki/ConvertExtension

여기에 가면 할수 있는건 다 나와있다.

다만 영어에 약한 나는

[extensions]
hgext.convert=

에서 = 뒤에 뭔가가 더 붙어야 되리라 생각했다. 두시간을 찾았는데 없더라.
근데 걍 .hgrc에 저렇게만 쓰면 되더라. --;

convert에는 3개의 명령이 있다.

include     포함
exclude    제외
rename    이름 바꿔

내가 회사에서 했던 경우를 예를 들면

/MainLib
    /3rdPartyLib
    /ALib
    /BLib
    /CLib

이런 구조를 가진 MainLib이란 Repository가 있었고,
그 밑에 여러개가 있었으며, 3rdPartyLib이 있었다.

근데 3rdPartyLib가 워낙 덩치가 컸다.
빌드된 바이너리 파일들이 엄청 많았고, 헤더파일도 엄청 많았다.
부스트가 3개 버젼이나 있었다..

여기서 하고자 했던건
3rdPartyLib을 별도 Repository로 빼고
MainLib의 SubRepository로 만들고 싶었다.
마치 svn에서 external 한것처럼..

스텝을 나눠보면
1. 제외하고 다시 만들고 (제외)
2. 빼서 고것만 따로 만들고 (포함)
3. SubRepository로 지정하는 3단계 이다.

hg convert --filemap filemapfile source dest 로 사용한다.
여기서 filemapfile에 위에서 말한 3개의 명령이라는걸 줄수 있다.
filemapfile 이건 파일이다.

1. 3rdPartyLibf가 제외된 MainLib을 만든다.
echo exclude 3rdPartyLib > myfilemap
hg convert --filemap myfilemap MainLib ~~~/MainLib

2. 3rdPartyLib만을 포함한 3rdPartyLib를 만든다.
echo include 3rdPartyLib > myfilemap
echo rename 3rdPartyLib . >> myfilemap
hg convert --filemap myfilemap MainLib ~~~/3rdPartyLib

3.
cd ~~~/3rdPartyLib
hg serv
cd ~~~/MainLib
echo 3rdPartyLib = http://~~~~ > .hgsub
hg clone http://~~~~ 3rdPartyLib
hg add
hg ci

이렇게 하면 완성된다.

알사람만 알지라.

중요한 점은 .hgsub로 해놓고 clone을 받아오지 않으면,
다른곳에서 MainLib을 clone 해갈때 SubRepository를 빈 깡통으로 온다.
그리고, MainLib안에 있는 SubRepository는 따로 일일이 update, commit, push, pull 해줘야 한다.
extension중에 한번에 다 처리하는게 있긴 하지만, 뭐.. 회사에서 그걸 굳이 쓸 환경은 아니기 때문에,
사용해보지 않았다.

'Develop' 카테고리의 다른 글

lambda 호출시간?  (0) 2012.05.30
lambda 메모리?  (0) 2012.05.30
Boost::any  (0) 2012.04.13
컴파일러 버젼 Define  (0) 2012.01.13
VisualStudio2010 Add-In : Dockable Form 띄우기  (0) 2011.11.07



모든 자료형을 담을수 있는 텝플릿 클래스

namespace boost
{
 class bad_any_cast;
 class any;
 template<typename T> T any_cast(any &);
 template<typename T> T any_cast(const any &);
 template<typename ValueType> const ValueType * any_cast(const any *);
 template<typename ValueType> ValueType * any_cast(any *);
 template<typename ValueType> ValueType * unsafe_any_cast(any *);
 template<typename ValueType> const ValueType * unsafe_any_cast(const any *);
}

사용 예제
http://www.boost.org/doc/libs/1_49_0/doc/html/any/s02.html

값을 꺼내올때는 any_cast()를 해야 한다.
any_cast()를 할때마다 내부에서 스트링연산 혹은 그에 준하는 연산을 한다.
런타임 시간에 매번 값을 꺼내오려면 꽤나 많은 비용을 지불해야 할거 같다.

아직 용도는 찾지 못하고 있다.


http://www.boost.org/doc/libs/1_49_0/doc/html/any.html

'Develop' 카테고리의 다른 글

lambda 메모리?  (0) 2012.05.30
hg convert  (0) 2012.05.04
컴파일러 버젼 Define  (0) 2012.01.13
VisualStudio2010 Add-In : Dockable Form 띄우기  (0) 2011.11.07
python simple web server  (0) 2011.10.03
/* Test for GCC > 3.2.0 */
#if __GNUC__ > 3 || \
    (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
                       (__GNUC_MINOR__ == 2 && \
                        __GNUC_PATCHLEVEL__ > 0))
#endif

-------------------------------

/* Test for Visual Studio 2010 */
#if _MSC_VER == 1600 
#endif
 

'Develop' 카테고리의 다른 글

hg convert  (0) 2012.05.04
Boost::any  (0) 2012.04.13
VisualStudio2010 Add-In : Dockable Form 띄우기  (0) 2011.11.07
python simple web server  (0) 2011.10.03
apache 서버  (0) 2011.09.29

Addin Project 에서...

1. 사용자 정의 폼을 하나 만든다.
       Project -> Add User Control...

2. 폼을 꾸민다.
       맘대로. 예쁘게

3. OnStartupComplete에 코드를 써준다.

public void OnStartupComplete(ref Array custom)
{
       try
      {
             object objTemp = null;
             Windows2 toolWins = (Windows2)_applicationObject.Windows;
             Window toolWin = toolWins.CreateToolWindow2(
                        _addInstance, Assembly.GetExecutingAssembly().Location,
                        "MyAddin4.UserControl1", "caption",
                        "GUID", ref objTemp);
             toolWin.Visiable = true;
      }
      catch (System.Exception ex)
     {
             MessageBox.Show(ex.Message);
     }
}

"MyAddin4.UserControl1"
1. 에서 생성한 form의 namespace와 form 의 이름을 써준다.
나의 경우 MyAddin4 : project이름, UserControl1 : form이름 이였다.

 "caption"
말 그대로 form의 이름이다.
SolutionExplorer, Output 같은 창들에 붙어있는 이름과 같은것.

"GUID"

Tools -> Create GUiD에서
새로 생성한 것을 사용한다.
아무거나 사용해도 될듯하다.

guid
http://msdn.microsoft.com/ko-kr/library/ms241442(v=vs.80).aspx

dockable
http://stackoverflow.com/questions/7363230/how-to-programmatically-dock-a-toolwindow-in-a-visual-studio-addin

'Develop' 카테고리의 다른 글

Boost::any  (0) 2012.04.13
컴파일러 버젼 Define  (0) 2012.01.13
python simple web server  (0) 2011.10.03
apache 서버  (0) 2011.09.29
samba 설정  (0) 2011.09.29


#Copyright Jon Berg , turtlemeat.com

import string,cgi,time
from os import curdir, sep
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
#import pri

class MyHandler(BaseHTTPRequestHandler):

    def do_GET(self):
        try:
            if self.path.endswith(".html"):
                f = open(curdir + sep + self.path) #self.path has /test.html
#note that this potentially makes every file on your computer readable by the internet

                self.send_response(200)
                self.send_header('Content-type', 'text/html')
                self.end_headers()
                self.wfile.write(f.read())
                f.close()
                return
            if self.path.endswith(".esp"):   #our dynamic content
                self.send_response(200)
                self.send_header('Content-type', 'text/html')
                self.end_headers()
                self.wfile.write("hey, today is the" + str(time.localtime()[7]))
                self.wfile.write(" day in the year " + str(time.localtime()[0]))
                return
               
            return
               
        except IOError:
            self.send_error(404,'File Not Found: %s' % self.path)
    

    def do_POST(self):
        global rootnode
        try:
            ctype, pdict = cgi.parse_header(self.headers.getheader('content-type'))
            if ctype == 'multipart/form-data':
                query=cgi.parse_multipart(self.rfile, pdict)
            self.send_response(301)
           
            self.end_headers()
            upfilecontent = query.get('upfile')
            print "filecontent", upfilecontent[0]
            self.wfile.write("<HTML>POST OK.<BR><BR>");
            self.wfile.write(upfilecontent[0]);
           
        except :
            pass

def main():
    try:
        server = HTTPServer(('', 80), MyHandler)
        print 'started httpserver...'
        server.serve_forever()
    except KeyboardInterrupt:
        print '^C received, shutting down server'
        server.socket.close()

if __name__ == '__main__':
    main()




출처 http://fragments.turtlemeat.com/pythonwebserver.php

'Develop' 카테고리의 다른 글

컴파일러 버젼 Define  (0) 2012.01.13
VisualStudio2010 Add-In : Dockable Form 띄우기  (0) 2011.11.07
apache 서버  (0) 2011.09.29
samba 설정  (0) 2011.09.29
vmware bridge 설정  (0) 2011.09.29

index.html 띄우기.

yum install httpd
yum install httpd-tools
yum --help
yum install php
yum install php-mbstring
yum install php-mysql
yum install php-gd
yum install mysql
yum install mysql-serer
yum install mysql-server
vi /etc/httpd/conf/httpd.conf

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName 192.168.0.10:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

$$ 설명 $$
ServerName     => ip 혹은 domain
DocumentRoot  => index.html 등이 담기는 루트 폴더

service httpd restart
service mysqld restart

setup -> Firewall configuration -> Customize 에서
www 외 필요한것들 체크



http://samples.tistory.com/79
http://blog.naver.com/micleneo?Redirect=Log&logNo=100087225311
http://urihouse.net/40129170768

'Develop' 카테고리의 다른 글

VisualStudio2010 Add-In : Dockable Form 띄우기  (0) 2011.11.07
python simple web server  (0) 2011.10.03
samba 설정  (0) 2011.09.29
vmware bridge 설정  (0) 2011.09.29
map less  (0) 2011.09.29
윈도우 폴더를 리눅스에서 사용

smbclient -L 윈도우아이피 -U 윈도우계정
mount -t cifs //윈도우아이피/공유폴더 리눅스폴더

[root@localhost samba]# smbclient -L 192.168.0.6 -U XXXXX
Enter XXXXX's password:
Domain=[XXXXX-PC] OS=[Windows 7 Ultimate 7601 Service Pack 1] Server=[Windows 7 Ultimate 6.1]
        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      ì›ê²© 관리
        C$              Disk      기본 공유
        D$              Disk      기본 공유
        IPC$            IPC       ì›ê²© IPC
        linux_share     Disk
        print$          Disk      프린터 드ë
                                                        Users           Disk
session request to 192.168.0.6 failed (Called name not present)
session request to 192 failed (Called name not present)
session request to *SMBSERVER failed (Called name not present)
NetBIOS over TCP disabled -- no workgroup available

[root@localhost samba]# mount -t cifs //192.168.0.6/linux_share /win_dir


http://blog.naver.com/kokoshi1?Redirect=Log&logNo=10108944654

'Develop' 카테고리의 다른 글

python simple web server  (0) 2011.10.03
apache 서버  (0) 2011.09.29
vmware bridge 설정  (0) 2011.09.29
map less  (0) 2011.09.29
bitTorrent 개발  (0) 2011.08.04
수동 IP설정을 해야 한다.

게이트웨이는 공유기 내부 IP로 설정

ifdown eth0
ifup eth0

을 하면 된다...
자세한건 링크로


http://blog.naver.com/mikael07?Redirect=Log&logNo=140035421481


ifup eth0 에 대한 해당하는 내용

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
* 네트워크 장치명
BOOTPROTO=[dhcp|static|none]
* DHCP = 유동IP로 설정
* STATIC or NONE = 고정IP로 설정
HWADDR=0:80:AD:7A:6F:A6
* 랜카드의 MAC 주소
BROADCAST=192.168.0.255
* Broadcast 주소. DHCP 사용시 설정안함. eth파일에 gateway 설정시 broadcast 설정안해도 작동함.
IPADDR=192.168.0.100
* IP 주소. DHCP 사용시 설정안함.
NETMASK=255.255.255.0
* Netmask 주소. DHCP 사용시 설정안함.
NETWORK=192.168.0.0
* Network 주소. DHCP 사용시 설정안함. eth파일에 gateway 설정시 broadcast 설정안해도 작동함.
GATEWAY=192.168.0.1
* Default Gateway 주소. /etc/sysconfig/network 에서 설정한 gateway 값보다 우선시 됩니다.
ONBOOT=[yes|no]
* 부팅시 장치 활성화 여부
TYPE=Ethernet
* type 을 설정

'Develop' 카테고리의 다른 글

apache 서버  (0) 2011.09.29
samba 설정  (0) 2011.09.29
map less  (0) 2011.09.29
bitTorrent 개발  (0) 2011.08.04
OpenSSL 윈도우 빌드  (0) 2011.08.04


#include <map>
#include <string>
using namespace std;

struct string_ptr_comp
{
 bool operator()(const string* lhs, const string* rhs)
 {
  return *lhs < *rhs;
 }
};


int main(int argc, char* argv[])
{
 string str_1("abc1");
 string str_2("abc2");
 string str_3("abc3");
 string str_4("abc4");
 string str_5("abc5");

 map<string*, int, string_ptr_comp> test_map;
  
 test_map.insert(make_pair(&str_3, 3));
 test_map.insert(make_pair(&str_4, 4));
 test_map.insert(make_pair(&str_5, 5));
 test_map.insert(make_pair(&str_1, 1));
 test_map.insert(make_pair(&str_2, 2));

 return 0;
}


WinApi.co.kr 사이트의 동등성 동일성 링크
http://winapi.co.kr/clec/cpp4/41-1-4.htm

'Develop' 카테고리의 다른 글

samba 설정  (0) 2011.09.29
vmware bridge 설정  (0) 2011.09.29
bitTorrent 개발  (0) 2011.08.04
OpenSSL 윈도우 빌드  (0) 2011.08.04
awk, sed를 이용한 문자열 조작 예1  (0) 2011.07.12
[11.08.04]
bitTorrent library
http://code.google.com/p/libtorrent
여기저기서 구하던중 빌드 잘되는 유일한 프로젝트
빌드까지 밖에 안했음

빌드 할때 OpenSSL이 필요했다.
http://www.openssl.org/source/

그리고 OpenSSL을 빌드할땐 perl이 필요했다.
http://www.activestate.com/










'Develop' 카테고리의 다른 글

vmware bridge 설정  (0) 2011.09.29
map less  (0) 2011.09.29
OpenSSL 윈도우 빌드  (0) 2011.08.04
awk, sed를 이용한 문자열 조작 예1  (0) 2011.07.12
awk 기본  (0) 2011.06.18

+ Recent posts