pijul_org / pijul

Fixing a conflict

By blabla on May 14, 2019
signed by pmeunier.
9a9ZaHip9NqqvPV4GX3Xpkjthe4mhLMJLWTnnihkVHDEFcXw3vQP4xtRAVU3CQFWwmgxpAofT8DqY2NrjCZnMsvC
This patch is in the following branches:
latest
master
testing
251
252

253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

        }
    };
    
    if settings.hash_only {
        // If in binary form, show the patches in chronological order.
        let start = settings.last.and_then(|last| {
            txn.rev_iter_applied(&branch, None)
                .filter(|(_, patchid)| {
                    // Only select patches that touch the input path
                    // (if that path exists).
                    settings.is_touched(&txn, *patchid)
                })
                .take(last)
                .last()
                .map(|(n, _)| n)
        });
        debug!("start {:?}", start);
        for (n, (applied, patchid)) in txn.iter_applied(&branch, start).enumerate() {
            if let Some(first) = settings.first {
                if n >= first {
                    break;
                }
            }
            settings.display_patch(&txn, &branch, applied, patchid)?
        }
        return Ok(());
    }

    let txn = repo.txn_begin()?;
    if let Some(v) = args.values_of("internal-id") {
        for (n, patchid) in v.filter_map(|x| PatchId::from_base58(x)).enumerate() {
            settings.display_patch(&txn, &branch, n as u64, patchid)?;
        }
    } else {
        let first = if let Some(first) = settings.first {
            txn.iter_applied(&branch, None)
                .filter(|(_, patchid)| settings.is_touched(&txn, *patchid))
                .take(first)
                .last()
                .map(|(n, _)| n)
        } else {
            None
        };
        for (n, (applied, patchid)) in txn.rev_iter_applied(&branch, first).enumerate() {
            if let Some(last) = settings.last {
                if n >= last {
                    break;
                }
            }
            settings.display_patch(&txn, &branch, applied, patchid)?;
        }
            debug!("hash: {:?}", hash_ext.to_base58());