bzr.rst
changeset 1334 9bf0d5a1f0cf
child 1425 5e4d2255fcbb
equal deleted inserted replaced
1333:81e09593158f 1334:9bf0d5a1f0cf
       
     1 .. -*- coding: utf-8; -*-
       
     2 .. include:: HEADER.rst
       
     3 
       
     4 ======
       
     5  BZR.
       
     6 ======
       
     7 .. contents::
       
     8 
       
     9 Import existing/init new project.
       
    10 =================================
       
    11 ::
       
    12 
       
    13   $ mkdir proj
       
    14   $ cd proj
       
    15   $ touch README Makefile main.c
       
    16   $ bzr init
       
    17   Created a standalone tree (format: 2a)
       
    18   $ bzr add .
       
    19   adding Makefile
       
    20   adding README
       
    21   adding main.c
       
    22   $ bzr ci -m 'Init proj.'
       
    23   Committing to: /cygdrive/e/home/devel/tmp/vcs-bzr/proj/
       
    24   added Makefile
       
    25   added README
       
    26   added main.c
       
    27   Committed revision 1.
       
    28 
       
    29 Cloning/branching repo.
       
    30 =======================
       
    31 
       
    32 'branch'/'get'/'clone' are aliases for 'branch' command::
       
    33 
       
    34   $ bzr clone proj/ proj-clone
       
    35   Branched 1 revision(s).
       
    36 
       
    37 Updating repo.
       
    38 ==============
       
    39 
       
    40 Incoming changes.
       
    41 =================
       
    42 ::
       
    43 
       
    44   $ bzr missing --theirs-only bzr://bzr.example.com/proj/trunk
       
    45 
       
    46 Outgoing changes.
       
    47 =================
       
    48 ::
       
    49 
       
    50   $ bzr st
       
    51   modified:
       
    52   README
       
    53   $ bzr ci -m up
       
    54   Committing to: /cygdrive/e/home/devel/tmp/vcs-bzr/proj-clone/
       
    55   modified README
       
    56   Committed revision 2.
       
    57   $ bzr missing --mine-only
       
    58   Using saved parent location: /cygdrive/e/home/devel/tmp/vcs-bzr/proj/
       
    59   You have 1 extra revision(s):
       
    60   ------------------------------------------------------------
       
    61   revno: 2
       
    62   committer: Oleksandr Gavenko <gavenkoa@gmail.com>
       
    63   branch nick: proj-clone
       
    64   timestamp: Mon 2011-01-24 00:21:27 +0200
       
    65   message:
       
    66     up
       
    67 
       
    68 Working copy status.
       
    69 ====================
       
    70 
       
    71 'status'/'st'/'stat' are aliases for 'status' command::
       
    72 
       
    73   $ bzr rm README
       
    74   deleted README
       
    75   $ bzr st
       
    76   removed:
       
    77     README
       
    78 
       
    79 Show working copy diff.
       
    80 =======================
       
    81 ::
       
    82 
       
    83   $ echo hello >README
       
    84   $ bzr diff
       
    85   === modified file 'README'
       
    86   --- README  2011-01-23 21:16:40 +0000
       
    87   +++ README  2011-01-23 21:37:47 +0000
       
    88   @@ -0,0 +1,1 @@
       
    89   +hello
       
    90 
       
    91 Show history log.
       
    92 =================
       
    93 ::
       
    94 
       
    95   $ bzr log
       
    96 
       
    97 Adding files to repo.
       
    98 =====================
       
    99 ::
       
   100 
       
   101   $ touch hello.c
       
   102   $ bzr add hello.c
       
   103   adding hello.c
       
   104 
       
   105 Deleting files from repo.
       
   106 =========================
       
   107 
       
   108 'remove'/'rm'/'del' are aliases for 'remove' command::
       
   109 
       
   110   $ bzr rm README
       
   111   deleted README
       
   112 
       
   113 Undo local changes.
       
   114 ===================
       
   115 ::
       
   116 
       
   117   $ bzr rm README
       
   118   deleted README
       
   119   $ bzr revert README
       
   120   +N  README
       
   121 
       
   122 Undo last commit.
       
   123 =================
       
   124 ::
       
   125 
       
   126   $ bzr add hello.c
       
   127   adding hello.c
       
   128 
       
   129   $ bzr ci -m bug
       
   130   Committing to: /cygdrive/e/home/devel/tmp/vcs-bzr/proj-clone/
       
   131   added hello.c
       
   132   Committed revision 2.
       
   133 
       
   134   $ bzr uncommit
       
   135   Are you sure? [y/n]: y
       
   136     2 Oleksandr Gavenko	2011-01-23
       
   137       bug
       
   138 
       
   139   The above revision(s) will be removed.
       
   140   You can restore the old tip by running:
       
   141     bzr pull . -r revid:gavenkoa@gmail.com-20110123213425-f2ca8umip5iw73is
       
   142 
       
   143   $ bzr st
       
   144   added:
       
   145   hello.c
       
   146 
       
   147 Info about bzr repo.
       
   148 ====================
       
   149 ::
       
   150 
       
   151   $ bzr info
       
   152   Standalone tree (format: 2a)
       
   153   Location:
       
   154     branch root: .
       
   155 
       
   156   Related branches:
       
   157     parent branch: /cygdrive/e/home/devel/tmp/vcs-bzr/proj
       
   158 
       
   159 Shelf changes.
       
   160 ==============
       
   161 ::
       
   162 
       
   163   $ bzr st
       
   164   modified:
       
   165     README
       
   166   $ bzr shelve --all
       
   167   Selected changes:
       
   168    M  README
       
   169   Changes shelved with id "1".
       
   170   $ bzr diff
       
   171   $ bzr shelve --list
       
   172   1: <no message>
       
   173   $  bzr unshelve
       
   174   Using changes with id "1".
       
   175    M  README
       
   176   All changes applied successfully.
       
   177   Deleted changes with id "1".
       
   178 
       
   179 How find most recent tag for current revision.
       
   180 ==============================================
       
   181 ::
       
   182 
       
   183   $ bzr tags --sort=time
       
   184