SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Start
             Podstawowe komendy
                          Bazaar
                       Mercurial
                           Linki




Systemy kontroli wersji Bazaar i Mercurial

            Michał Bugno             Krzysztof Goj


   19 grudnia 2008, Akademia Górniczo-Hutnicza




       Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                   Start
                                             Trochę historii
                     Podstawowe komendy
                                             Co to jest DVCS?
                                  Bazaar
                                             Zalety
                               Mercurial
                                             Wady
                                   Linki
                                             Instalacja



VCS


 VCS czyli Version Control System pozwala na
      przetrzymywanie historii zmian w plikach
      powrót do ewentualnych poprzednich wersji pliku
      równoczesną pracę kilku osób przy projekcie
      późniejsze rozwiązywanie ewentualnych konfliktów (jeśli ten
      sam plik edytowała więcej niż jedna osoba)
      tworzenie gałęzi, czyli odłączanie się w pewnym momencie od
      głównego projektu



               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                   Start
                                             Trochę historii
                     Podstawowe komendy
                                             Co to jest DVCS?
                                  Bazaar
                                             Zalety
                               Mercurial
                                             Wady
                                   Linki
                                             Instalacja



Narzędzia

  VCS wyposażony jest w zestaw przydatnych narzędzi, które
  ułatwiają pracę:
      log – wyświetla listę rewizji wraz z ewentualnymi
      komentarzami do rewizji
      diff – pozwala na wyświetlenie różnic między ostatnią
      rewizją a naszymi aktualnymi zmianami
      revert – cofa aktualne zmiany
      blame – najciekawsze :) pozwala na podgląd, kto zmienił
      którą linię w pliku
      praise – j.w. ale w tym pozytywnym kontekście :)

               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                  Start
                                            Trochę historii
                    Podstawowe komendy
                                            Co to jest DVCS?
                                 Bazaar
                                            Zalety
                              Mercurial
                                            Wady
                                  Linki
                                            Instalacja



CVS – Concurrent Versions System



     stworzony w latach .80
     brak atomowych commitów!
     brak suportu dla przenoszenia plików/katalogów
     obsługiwał już branching




              Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                     Start
                                               Trochę historii
                       Podstawowe komendy
                                               Co to jest DVCS?
                                    Bazaar
                                               Zalety
                                 Mercurial
                                               Wady
                                     Linki
                                               Instalacja



SVN - Subversion


     stosunkowo młody – 2000 rok
     tworzony na CVS potem przeszedł na siebie
     cel – kompatybilność z CVS
     atomowość
     przesyłane różnice a nie całe pliki
     properties: executable, ignore, mime-type
     popularny



                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                   Start
                                             Trochę historii
                     Podstawowe komendy
                                             Co to jest DVCS?
                                  Bazaar
                                             Zalety
                               Mercurial
                                             Wady
                                   Linki
                                             Instalacja



D czyli Distributed



      bardzo młode projekty – Bazaar, Mercurial, Git 2005 r.
      inna ideologia – nie ma centralnego repozytorium
      wprowadzają dużo usprawnień względem SVN
      troszkę bardziej skomplikowane




               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                   Start
                                             Trochę historii
                     Podstawowe komendy
                                             Co to jest DVCS?
                                  Bazaar
                                             Zalety
                               Mercurial
                                             Wady
                                   Linki
                                             Instalacja



Co to jest rozproszony system kontroli wersji?




      brak centralnego serwera
      popularne akcje jak commit, log są lokalne




               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                      Start
                                                Trochę historii
                        Podstawowe komendy
                                                Co to jest DVCS?
                                     Bazaar
                                                Zalety
                                  Mercurial
                                                Wady
                                      Linki
                                                Instalacja



Zalety


         niezależność od dostępności serwera
         (brak internetu != FAIL)
         bezpieczeństwo - każda gałąź to osobny projekt wraz z
         logami, historią, itp itd.
         łatwiejsze dodawanie dużej funkcjonalności do projektu
         wymagającej dłuższej pracy bez aktualizacji
         lepsza współpraca ludzi poza projektem, którzy chcieliby
         dodać coś do projektu



                  Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                    Start
                                              Trochę historii
                      Podstawowe komendy
                                              Co to jest DVCS?
                                   Bazaar
                                              Zalety
                                Mercurial
                                              Wady
                                    Linki
                                              Instalacja



Wady



       dojrzałość – SVN jest już dobrze otestowany przez
       użytkowników
       przetrzymywanie całej historii zmian – zajętość miejsca
       stopień skomplikowania – trochę więcej komend, inna idea




                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
VCS
                                    Start
                                              Trochę historii
                      Podstawowe komendy
                                              Co to jest DVCS?
                                   Bazaar
                                              Zalety
                                Mercurial
                                              Wady
                                    Linki
                                              Instalacja



Instalacja


  Instalacja jest na wszystkich systemach prosta, szybka
  i bezbolesna.
      wszędzie: źródła
      GNU/Linux: paczki
      Windows: instalator
      MacOS X: MacPorts, paczki (Mercurial)




                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                              add
                                    Start
                                              ignore
                      Podstawowe komendy
                                              log i status
                                   Bazaar
                                              diff
                                Mercurial
                                              revert
                                    Linki
                                              branch/clone
                                              serve


init – rozpoczęcie wersjonowania katalogu
                                   dwa sposoby



          Bazaar                                             Mercurial
pykonik bzr init repo                            repo hg init
pykonik ls                                       repo ls -A
        repo                                                 .hg
pykonik cd repo
   repo ls -A
        .bzr

                       można zamienić bzr ↔ hg

                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                               add
                                     Start
                                               ignore
                       Podstawowe komendy
                                               log i status
                                    Bazaar
                                               diff
                                 Mercurial
                                               revert
                                     Linki
                                               branch/clone
                                               serve


add – dodanie plików
   repo mkdir test other
   repo touch a1 a2 test/a{3,4} other/a5



         Bazaar                                               Mercurial
  repo bzr add                                    repo hg add
       added   a1                                             adding   a1
       added   a2                                             adding   a2
       added   other                                          adding   other
       added   test                                           adding   test
       added   other/a5                                       adding   other/a5
       added   test/a3                                        adding   test/a3
       added   test/a4                                        adding   test/a4

                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                               add
                                     Start
                                               ignore
                       Podstawowe komendy
                                               log i status
                                    Bazaar
                                               diff
                                 Mercurial
                                               revert
                                     Linki
                                               branch/clone
                                               serve


add – dodanie plików

   repo mkdir -p dir/subdir
   repo touch file dir/subdir/file



         Bazaar                                               Mercurial
  repo bzr add file dir                            repo hg add file dir
       added   file                                           adding dir/subdir/file
       added   dir
       added   dir/subdir
       added   dir/subdir/file



                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                                add
                                      Start
                                                ignore
                        Podstawowe komendy
                                                log i status
                                     Bazaar
                                                diff
                                  Mercurial
                                                revert
                                      Linki
                                                branch/clone
                                                serve


ignore – ignoruj pliki



          Bazaar                                               Mercurial
   repo bzr ignore “*.o”                           repo vim .hgignore
   repo bzr ignore “RE:d.pa”                       repo cat .hgignore
   repo cat .bzrignore                                         syntax: glob
                                                               *.o
        *.o
                                                               syntax: regexp
        RE:d.pa
                                                               d.pa
 ˜/.bazaar/ignore
                                                 per-user, per-user*project (hgrc)
                                                 [ui]
                                                 ignore = ścieżka do pliku

                  Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                             add
                                   Start
                                             ignore
                     Podstawowe komendy
                                             log i status
                                  Bazaar
                                             diff
                               Mercurial
                                             revert
                                   Linki
                                             branch/clone
                                             serve


status – stan kopii roboczej
   repo echo “new content” >> a1
   repo touch a3



         Bazaar                                             Mercurial
  repo bzr rm a2                                repo hg rm –after
       deleted a2                                           removing a2
  repo bzr status                               repo hg status
       removed:                                             M a1
         a2                                                 R a2
       modified:                                            ? a3
         a1
       unknown:
         a3
               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                              add
                                    Start
                                              ignore
                      Podstawowe komendy
                                              log i status
                                   Bazaar
                                              diff
                                Mercurial
                                              revert
                                    Linki
                                              branch/clone
                                              serve


diff


         Bazaar                                              Mercurial
  repo hg diff                                    repo bzr diff
       diff -r 19ade018a43e                                  === modified file ’a1’
       a1                                                    --- a1 2008-04-10
       --- a/a1   Thu Apr 10                                 12:33:42 +0000
       14:34:08 2008 +0200                                   +++ a1 2008-04-10
       +++ b/a1   Thu Apr 10                                 12:34:30 +0000
       14:34:30 2008 +0200                                   @@ -0,0 +1,1 @@
       @@ -0,0 +1,1 @@                                       +new content
       +new content
                                                           === removed file ’a2’
                                                           === removed file
                Michał Bugno, Krzysztof Goj                ’file’
                                              Systemy kontroli wersji Bazaar i Mercurial
init
                                               add
                                     Start
                                               ignore
                       Podstawowe komendy
                                               log i status
                                    Bazaar
                                               diff
                                 Mercurial
                                               revert
                                     Linki
                                               branch/clone
                                               serve


revert – wycofaj zmiany



         Bazaar                                               Mercurial
  repo echo stuff >> a1                            repo echo stuff >> a1
  repo bzr rm a2 file                              repo hg rm a2 file
  repo bzr revert                                 repo hg revert
       +N a2                                                  reverting a1
       +N file                                                undeleting a2
       M a1                                                   reverting file
  repo ls a1*                                     repo ls a1*
       a1 a1.~1~                                              a1 a1.orig


                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                              add
                                    Start
                                              ignore
                      Podstawowe komendy
                                              log i status
                                   Bazaar
                                              diff
                                Mercurial
                                              revert
                                    Linki
                                              branch/clone
                                              serve


commit – stworzenie rewizji


          Bazaar                                             Mercurial
  repo bzr ci -m “Init”                         repo hg ci -m “Init”
        Committing to:                          repo vim a1
        pykonik/repo/
        added a1
                                                repo hg ci
               ...                             Otwiera sesję edytora
        added test/a4                           repo hg ci -m “Changes in a1”
        Commited revision 1.
  repo vim a1
  repo bzr ci
 Otwiera sesję edytora
  repo bzr ci -m “Changes in a1”
                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                                 add
                                       Start
                                                 ignore
                         Podstawowe komendy
                                                 log i status
                                      Bazaar
                                                 diff
                                   Mercurial
                                                 revert
                                       Linki
                                                 branch/clone
                                                 serve


bzr log – wyświetlenie historii zmian
   repo bzr log
        ------------------------------------------------------------
        revno: 2
        committer: Michal Bugno
        <michal.bugno@gmail.com>
        branch nick: repo
        timestamp: Sun 2008-04-06
        22:16:40 +0200
        message:
         Changes in a1
        ------------------------------------------------------------
        revno: 1
        committer: Michal Bugno
        <michal.bugno@gmail.com>
        branch nick: repo
        timestamp: Sun 2008-04-06
        21:54:17 +0200
        message:
         Init      Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                                add
                                      Start
                                                ignore
                        Podstawowe komendy
                                                log i status
                                     Bazaar
                                                diff
                                  Mercurial
                                                revert
                                      Linki
                                                branch/clone
                                                serve


hg log – wyświetlenie historii zmian


                    opcja -v włącza więcej szczegółów

   repo hg log -v

        changeset: 8:a6ba8f70ce7eba6a73e5715a439b06a9584106ee
        user:      Krzysiek Goj <bin-krzysiek@poczta.gazeta.pl>
        date:      Thu Apr 10 02:04:19 2008 +0200
        files:     pykonik dvcs.tex
        description:
        Bardzo ciekawe zmiany.
                   - nowe slajdy
                   - więcej przykładów




                  Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
init
                                                 add
                                      Start
                                                 ignore
                        Podstawowe komendy
                                                 log i status
                                     Bazaar
                                                 diff
                                  Mercurial
                                                 revert
                                      Linki
                                                 branch/clone
                                                 serve


branch/clone – stworzenie kopii repozytorium

            Bazaar                                              Mercurial
pykonik bzr branch repo other                   pykonik hg clone repo other
          Branched 2 revision(s).                               3 files updated, 0 files
                                                                merged, 0 files removed,
pykonik   cd other                                              0 files unresolved
  other   bzr log                               pykonik         cd other
  other   vim a1                                  other         hg log
  other   bzr mv test dir                         other         vim a1
  other   bzr st                                  other         hg mv dir test
          renamed:                                other         hg st
          test ⇒ dir
                                                                M a1
          modified:
                                                                A test/a3
          a1
                                                                R dir/a3
  other bzr ci -m “. . . ”                         other hg ci -m “. . . ”
                  Michał Bugno, Krzysztof Goj    Systemy kontroli wersji Bazaar i Mercurial
init
                                               add
                                    Start
                                               ignore
                      Podstawowe komendy
                                               log i status
                                   Bazaar
                                               diff
                                Mercurial
                                               revert
                                    Linki
                                               branch/clone
                                               serve


serve




          Bazaar                                              Mercurial
pykonik bzr serve –port 2345                  pykonik hg serve -p 5432
        listening on port:      2345          pykonik hg serve -v
                                                              listening at
                                                              http://abulafia:8000/




                Michał Bugno, Krzysztof Goj    Systemy kontroli wersji Bazaar i Mercurial
Start
                    Podstawowe komendy      Praca zcentralizowania
                                 Bazaar     Praca zdecentralizowania
                              Mercurial     Pozostałe
                                  Linki



Konflikty



     bzr dobrze radzi sobie z rozwiązywaniem (założenia DVCS!)
     foo.BASE, foo.THIS, foo.OTHER
     znaczniki w plikach – miejsca konfliktu
     bzr resolved – oznaczenie konfliktu jako rozwiązany




              Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                      Podstawowe komendy      Praca zcentralizowania
                                   Bazaar     Praca zdecentralizowania
                                Mercurial     Pozostałe
                                    Linki



Praca zcentralizowana – czyli bzr jako svn


  Bazaar może działać jak svn – istnienie jednego, centralnego
  repozytorium, które jest uaktualniane przez użytkowników, każdy
  commit poprzedzany jest update–em.
      branch i checkout – różnice
      konwersja branch ⇒ checkout – bzr bind
      checkout ⇒ . . . ⇒ update ⇒ . . . ⇒ commit




                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                      Podstawowe komendy      Praca zcentralizowania
                                   Bazaar     Praca zdecentralizowania
                                Mercurial     Pozostałe
                                    Linki



Gdy brak centralnego serwera. . .



  Kiedy jesteśmy odcięci od internetu/sieci nadal jest możliwość
  wersjonowania plików w checkout-cie.
      bzr ci --local – zapisz zmiany lokalnie
      bzr unbind – ckechout ⇒ branch
      bzr bind ... – branch ⇒ checkout




                Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                       Podstawowe komendy      Praca zcentralizowania
                                    Bazaar     Praca zdecentralizowania
                                 Mercurial     Pozostałe
                                     Linki



bzr merge – połączenie branch’y
   repo bzr ci -m “. . . ”
   repo bzr branch ../other
        M a1
        R test/ ⇒ dir/
        All changes applied
        successfully.
   repo bzr st
        renamed:
        test ⇒ dir
        modified:
        a1
        pending merges:
        John Doe 2008-04-06
        renamed and modified

   repo bzr ci -m “merged”
                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                     Podstawowe komendy      Praca zcentralizowania
                                  Bazaar     Praca zdecentralizowania
                               Mercurial     Pozostałe
                                   Linki



Praca zdecentralizowana z bzr



      main branch – umowny branch główny
      własny branch do zmian – w nim
      edytujemy/naprawiamy/dodajemy
      zapisywanie zmian: różne metody (gatekeeper lub zwykły
      commit)




               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                     Podstawowe komendy      Praca zcentralizowania
                                  Bazaar     Praca zdecentralizowania
                               Mercurial     Pozostałe
                                   Linki



Ciekawostki

     uncommit
      /.bazaar/bazaar.conf – email, editor
     aliasy do różnych komend, np. bzr commit --strict,
     status --short
     commit --fixes lp:5
     pluginy – integracja z innymi VCSami
         hg – readonly
         git – readonly
         hgimport – importowanie mercuriala
         svn – współpraca z bindingami svn


               Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                                               konfiguracja
                       Podstawowe komendy
                                               push / pull
                                    Bazaar
                                               hooki
                                 Mercurial
                                               inne
                                     Linki



konfiguracja


      ˜/.hgrc
      .hg/hgrc
  [ui]
  username = Krzysiek Goj <bin-krzysiek@poczta.gazeta.pl>
  ignore = /home/goj/.hgignore-global
  [extensions]
  mq =
  hbisect =



                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                                               konfiguracja
                       Podstawowe komendy
                                               push / pull
                                    Bazaar
                                               hooki
                                 Mercurial
                                               inne
                                     Linki



push i pull, czyli współpraca z innymi




   repo   hg   push docelowe repo
   repo   hg   pull źródłowe repo
   repo   hg   update
   repo   hg   merge




                 Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                                                konfiguracja
                          Podstawowe komendy
                                                push / pull
                                       Bazaar
                                                hooki
                                    Mercurial
                                                inne
                                        Linki



hooki – jak reagować na wydarzenia i wymuszać niektóre
rzeczy

 pykonik cat .hg/hgrc
         [hooks]
         pretxncommit.missing add remove = ! hg status
         | grep -q [ ?!]

      również moduły pythona
      incoming
      update
      . . . i 10 innych


                 Michał Bugno, Krzysztof Goj    Systemy kontroli wersji Bazaar i Mercurial
Start
                                            konfiguracja
                    Podstawowe komendy
                                            push / pull
                                 Bazaar
                                            hooki
                              Mercurial
                                            inne
                                  Linki



inne tematy



     cgi
     bisect
     konfiguracja
     branch
     rozszerzenia




              Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial
Start
                        Podstawowe komendy
                                     Bazaar
                                  Mercurial
                                      Linki



Linki

  Bazaar
    http://bazaar-vcs.org
    http://launchpad.net
  Mercurial
        http://www.selenic.com/mercurial/wiki/
        http://hgbook.red-bean.com/
        http://www.ivy.fr/mercurial/ref/v1.0/Mercurial-Usage-v1.0.pdf
        http://sharesource.org/


                  Michał Bugno, Krzysztof Goj   Systemy kontroli wersji Bazaar i Mercurial

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Bazaar Mercurial

  • 1. Start Podstawowe komendy Bazaar Mercurial Linki Systemy kontroli wersji Bazaar i Mercurial Michał Bugno Krzysztof Goj 19 grudnia 2008, Akademia Górniczo-Hutnicza Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 2. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja VCS VCS czyli Version Control System pozwala na przetrzymywanie historii zmian w plikach powrót do ewentualnych poprzednich wersji pliku równoczesną pracę kilku osób przy projekcie późniejsze rozwiązywanie ewentualnych konfliktów (jeśli ten sam plik edytowała więcej niż jedna osoba) tworzenie gałęzi, czyli odłączanie się w pewnym momencie od głównego projektu Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 3. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja Narzędzia VCS wyposażony jest w zestaw przydatnych narzędzi, które ułatwiają pracę: log – wyświetla listę rewizji wraz z ewentualnymi komentarzami do rewizji diff – pozwala na wyświetlenie różnic między ostatnią rewizją a naszymi aktualnymi zmianami revert – cofa aktualne zmiany blame – najciekawsze :) pozwala na podgląd, kto zmienił którą linię w pliku praise – j.w. ale w tym pozytywnym kontekście :) Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 4. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja CVS – Concurrent Versions System stworzony w latach .80 brak atomowych commitów! brak suportu dla przenoszenia plików/katalogów obsługiwał już branching Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 5. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja SVN - Subversion stosunkowo młody – 2000 rok tworzony na CVS potem przeszedł na siebie cel – kompatybilność z CVS atomowość przesyłane różnice a nie całe pliki properties: executable, ignore, mime-type popularny Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 6. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja D czyli Distributed bardzo młode projekty – Bazaar, Mercurial, Git 2005 r. inna ideologia – nie ma centralnego repozytorium wprowadzają dużo usprawnień względem SVN troszkę bardziej skomplikowane Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 7. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja Co to jest rozproszony system kontroli wersji? brak centralnego serwera popularne akcje jak commit, log są lokalne Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 8. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja Zalety niezależność od dostępności serwera (brak internetu != FAIL) bezpieczeństwo - każda gałąź to osobny projekt wraz z logami, historią, itp itd. łatwiejsze dodawanie dużej funkcjonalności do projektu wymagającej dłuższej pracy bez aktualizacji lepsza współpraca ludzi poza projektem, którzy chcieliby dodać coś do projektu Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 9. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja Wady dojrzałość – SVN jest już dobrze otestowany przez użytkowników przetrzymywanie całej historii zmian – zajętość miejsca stopień skomplikowania – trochę więcej komend, inna idea Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 10. VCS Start Trochę historii Podstawowe komendy Co to jest DVCS? Bazaar Zalety Mercurial Wady Linki Instalacja Instalacja Instalacja jest na wszystkich systemach prosta, szybka i bezbolesna. wszędzie: źródła GNU/Linux: paczki Windows: instalator MacOS X: MacPorts, paczki (Mercurial) Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 11. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve init – rozpoczęcie wersjonowania katalogu dwa sposoby Bazaar Mercurial pykonik bzr init repo repo hg init pykonik ls repo ls -A repo .hg pykonik cd repo repo ls -A .bzr można zamienić bzr ↔ hg Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 12. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve add – dodanie plików repo mkdir test other repo touch a1 a2 test/a{3,4} other/a5 Bazaar Mercurial repo bzr add repo hg add added a1 adding a1 added a2 adding a2 added other adding other added test adding test added other/a5 adding other/a5 added test/a3 adding test/a3 added test/a4 adding test/a4 Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 13. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve add – dodanie plików repo mkdir -p dir/subdir repo touch file dir/subdir/file Bazaar Mercurial repo bzr add file dir repo hg add file dir added file adding dir/subdir/file added dir added dir/subdir added dir/subdir/file Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 14. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve ignore – ignoruj pliki Bazaar Mercurial repo bzr ignore “*.o” repo vim .hgignore repo bzr ignore “RE:d.pa” repo cat .hgignore repo cat .bzrignore syntax: glob *.o *.o syntax: regexp RE:d.pa d.pa ˜/.bazaar/ignore per-user, per-user*project (hgrc) [ui] ignore = ścieżka do pliku Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 15. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve status – stan kopii roboczej repo echo “new content” >> a1 repo touch a3 Bazaar Mercurial repo bzr rm a2 repo hg rm –after deleted a2 removing a2 repo bzr status repo hg status removed: M a1 a2 R a2 modified: ? a3 a1 unknown: a3 Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 16. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve diff Bazaar Mercurial repo hg diff repo bzr diff diff -r 19ade018a43e === modified file ’a1’ a1 --- a1 2008-04-10 --- a/a1 Thu Apr 10 12:33:42 +0000 14:34:08 2008 +0200 +++ a1 2008-04-10 +++ b/a1 Thu Apr 10 12:34:30 +0000 14:34:30 2008 +0200 @@ -0,0 +1,1 @@ @@ -0,0 +1,1 @@ +new content +new content === removed file ’a2’ === removed file Michał Bugno, Krzysztof Goj ’file’ Systemy kontroli wersji Bazaar i Mercurial
  • 17. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve revert – wycofaj zmiany Bazaar Mercurial repo echo stuff >> a1 repo echo stuff >> a1 repo bzr rm a2 file repo hg rm a2 file repo bzr revert repo hg revert +N a2 reverting a1 +N file undeleting a2 M a1 reverting file repo ls a1* repo ls a1* a1 a1.~1~ a1 a1.orig Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 18. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve commit – stworzenie rewizji Bazaar Mercurial repo bzr ci -m “Init” repo hg ci -m “Init” Committing to: repo vim a1 pykonik/repo/ added a1 repo hg ci ... Otwiera sesję edytora added test/a4 repo hg ci -m “Changes in a1” Commited revision 1. repo vim a1 repo bzr ci Otwiera sesję edytora repo bzr ci -m “Changes in a1” Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 19. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve bzr log – wyświetlenie historii zmian repo bzr log ------------------------------------------------------------ revno: 2 committer: Michal Bugno <michal.bugno@gmail.com> branch nick: repo timestamp: Sun 2008-04-06 22:16:40 +0200 message: Changes in a1 ------------------------------------------------------------ revno: 1 committer: Michal Bugno <michal.bugno@gmail.com> branch nick: repo timestamp: Sun 2008-04-06 21:54:17 +0200 message: Init Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 20. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve hg log – wyświetlenie historii zmian opcja -v włącza więcej szczegółów repo hg log -v changeset: 8:a6ba8f70ce7eba6a73e5715a439b06a9584106ee user: Krzysiek Goj <bin-krzysiek@poczta.gazeta.pl> date: Thu Apr 10 02:04:19 2008 +0200 files: pykonik dvcs.tex description: Bardzo ciekawe zmiany. - nowe slajdy - więcej przykładów Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 21. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve branch/clone – stworzenie kopii repozytorium Bazaar Mercurial pykonik bzr branch repo other pykonik hg clone repo other Branched 2 revision(s). 3 files updated, 0 files merged, 0 files removed, pykonik cd other 0 files unresolved other bzr log pykonik cd other other vim a1 other hg log other bzr mv test dir other vim a1 other bzr st other hg mv dir test renamed: other hg st test ⇒ dir M a1 modified: A test/a3 a1 R dir/a3 other bzr ci -m “. . . ” other hg ci -m “. . . ” Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 22. init add Start ignore Podstawowe komendy log i status Bazaar diff Mercurial revert Linki branch/clone serve serve Bazaar Mercurial pykonik bzr serve –port 2345 pykonik hg serve -p 5432 listening on port: 2345 pykonik hg serve -v listening at http://abulafia:8000/ Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 23. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki Konflikty bzr dobrze radzi sobie z rozwiązywaniem (założenia DVCS!) foo.BASE, foo.THIS, foo.OTHER znaczniki w plikach – miejsca konfliktu bzr resolved – oznaczenie konfliktu jako rozwiązany Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 24. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki Praca zcentralizowana – czyli bzr jako svn Bazaar może działać jak svn – istnienie jednego, centralnego repozytorium, które jest uaktualniane przez użytkowników, każdy commit poprzedzany jest update–em. branch i checkout – różnice konwersja branch ⇒ checkout – bzr bind checkout ⇒ . . . ⇒ update ⇒ . . . ⇒ commit Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 25. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki Gdy brak centralnego serwera. . . Kiedy jesteśmy odcięci od internetu/sieci nadal jest możliwość wersjonowania plików w checkout-cie. bzr ci --local – zapisz zmiany lokalnie bzr unbind – ckechout ⇒ branch bzr bind ... – branch ⇒ checkout Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 26. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki bzr merge – połączenie branch’y repo bzr ci -m “. . . ” repo bzr branch ../other M a1 R test/ ⇒ dir/ All changes applied successfully. repo bzr st renamed: test ⇒ dir modified: a1 pending merges: John Doe 2008-04-06 renamed and modified repo bzr ci -m “merged” Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 27. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki Praca zdecentralizowana z bzr main branch – umowny branch główny własny branch do zmian – w nim edytujemy/naprawiamy/dodajemy zapisywanie zmian: różne metody (gatekeeper lub zwykły commit) Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 28. Start Podstawowe komendy Praca zcentralizowania Bazaar Praca zdecentralizowania Mercurial Pozostałe Linki Ciekawostki uncommit /.bazaar/bazaar.conf – email, editor aliasy do różnych komend, np. bzr commit --strict, status --short commit --fixes lp:5 pluginy – integracja z innymi VCSami hg – readonly git – readonly hgimport – importowanie mercuriala svn – współpraca z bindingami svn Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 29. Start konfiguracja Podstawowe komendy push / pull Bazaar hooki Mercurial inne Linki konfiguracja ˜/.hgrc .hg/hgrc [ui] username = Krzysiek Goj <bin-krzysiek@poczta.gazeta.pl> ignore = /home/goj/.hgignore-global [extensions] mq = hbisect = Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 30. Start konfiguracja Podstawowe komendy push / pull Bazaar hooki Mercurial inne Linki push i pull, czyli współpraca z innymi repo hg push docelowe repo repo hg pull źródłowe repo repo hg update repo hg merge Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 31. Start konfiguracja Podstawowe komendy push / pull Bazaar hooki Mercurial inne Linki hooki – jak reagować na wydarzenia i wymuszać niektóre rzeczy pykonik cat .hg/hgrc [hooks] pretxncommit.missing add remove = ! hg status | grep -q [ ?!] również moduły pythona incoming update . . . i 10 innych Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 32. Start konfiguracja Podstawowe komendy push / pull Bazaar hooki Mercurial inne Linki inne tematy cgi bisect konfiguracja branch rozszerzenia Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial
  • 33. Start Podstawowe komendy Bazaar Mercurial Linki Linki Bazaar http://bazaar-vcs.org http://launchpad.net Mercurial http://www.selenic.com/mercurial/wiki/ http://hgbook.red-bean.com/ http://www.ivy.fr/mercurial/ref/v1.0/Mercurial-Usage-v1.0.pdf http://sharesource.org/ Michał Bugno, Krzysztof Goj Systemy kontroli wersji Bazaar i Mercurial