`brz add` in git format doesn't report files added

Bug #1799482 reported by Brian de Alwis on 2018-10-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
High
Brian de Alwis

Bug Description

Version: brz at HEAD (`brz version` = `3.0a1`)

Steps to repeat:
```
$ brz init --format git foo
$ cd foo
$ mkdir a b
$ echo a > a/file.txt
$ echo b > b/file.txt
$ brz add a b
adding a
adding b
adding b
adding b
```

I expected to see:
```
$ brz add a b
adding a
adding b
adding a/file.txt
adding b/file.txt
```

It looks like the culprit is `breezy/git/workingtree.py(504)smart_add()` where it should be using `call_action(subp, kind)`
```
-> call_action(filepath, kind)
(Pdb) l
499 if subpath in index:
500 # Already present
501 continue
502 if subp in conflicts_related:
503 continue
504 -> call_action(filepath, kind)
505 if save:
506 self._index_add_entry(subp, kind)
507 added.append(subp)
508 return added, ignored
509
```

Related branches

On Tue, Oct 23, 2018 at 02:35:38PM -0000, Brian de Alwis wrote:
> Public bug reported:
>
> Version: brz at HEAD (`brz version` = `3.0a1`)
>
> Steps to repeat:
> ```
> $ brz init --format git foo
> $ cd foo
> $ mkdir a b
> $ echo a > a/file.txt
> $ echo b > b/file.txt
> $ brz add a b
> adding a
> adding b
> adding b
> adding b
> ```
>
> I expected to see:
> ```
> $ brz add a b
> adding a
> adding b
> adding a/file.txt
> adding b/file.txt
> ```
>
> It looks like the culprit is `breezy/git/workingtree.py(504)smart_add()` where it should be using `call_action(subp, kind)`
> ```
> -> call_action(filepath, kind)
> (Pdb) l
> 499 if subpath in index:
> 500 # Already present
> 501 continue
> 502 if subp in conflicts_related:
> 503 continue
> 504 -> call_action(filepath, kind)
> 505 if save:
> 506 self._index_add_entry(subp, kind)
> 507 added.append(subp)
> 508 return added, ignored
> 509
> ```
Thanks for the report and suggested fix. Can you create a merge
proposal? With tests would be great, but without is fine too.

Cheers,

Jelmer

Jelmer Vernooij (jelmer) on 2018-10-23
Changed in brz:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.0.0
Brian de Alwis (slyguy) wrote :

Sorry, I wasn't sure how to write a test for this.

Jelmer Vernooij (jelmer) on 2018-10-24
Changed in brz:
status: Triaged → Fix Committed

On Wed, Oct 24, 2018 at 01:21:21AM -0000, Brian de Alwis wrote:
> Sorry, I wasn't sure how to write a test for this.
No worries; proposed your fix with some additional tests in https://code.launchpad.net/~jelmer/brz/fix1799482/+merge/357734

Jelmer Vernooij (jelmer) on 2018-10-25
Changed in brz:
assignee: nobody → Brian de Alwis (slyguy)
Jelmer Vernooij (jelmer) on 2018-11-23
Changed in brz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers